labelme教程_label shop

labelme教程_label shopdelete删除标签时,不再弹出对话框找到./python/site-packages/labelme/app.pydefdeleteSelectedShape(self):self.remLabels(self.canvas.deleteSelected())self.setDirty()ifself.noShapes():foractioninself.actions.onShapesPresent:..

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

  1. 如何查看自己labelme安装的位置
    例如通过pip3.8安装
pip3.8 install labelme

可以通过查看pip3.8版本寻找对应的python安装位置

pip3.8 -V

然后就可以在对应版本的python下修改相应的文件

  1. delete 删除标签时,不再弹出对话框

    找到./python/site-packages/labelme/app.py

def deleteSelectedShape(self):
        self.remLabels(self.canvas.deleteSelected())
        self.setDirty()
        if self.noShapes():
            for action in self.actions.onShapesPresent:
                action.setEnabled(False)
        #yes, no = QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No
        #msg = self.tr(
        #    "You are about to permanently delete {} polygons, "
        #    "proceed anyway?"
        #).format(len(self.canvas.selectedShapes))
        #if yes == QtWidgets.QMessageBox.warning(
        #    self, self.tr("Attention"), msg, yes | no, yes
        #):
            #self.remLabels(self.canvas.deleteSelected())
            #self.setDirty()
            #if self.noShapes():
            #    for action in self.actions.onShapesPresent:
            #        action.setEnabled(False)
  1. 选择其他图像,自动保存当前标签信息,不再弹出对话框
    找到./python/site-packages/labelme/app.py
def mayContinue(self):
        if not self.dirty:
            return True
        self.saveFile()
        return True
        #mb = QtWidgets.QMessageBox
        #msg = self.tr('Save annotations to "{}" before closing?').format(
        #    self.filename
        #)
        #answer = mb.question(
        #    self,
        #    self.tr("Save annotations?"),
        #    msg,
        #    mb.Save | mb.Discard | mb.Cancel,
        #    mb.Save,
        #)
        #if answer == mb.Discard:
        #    return True
        #elif answer == mb.Save:
        #    self.saveFile()
        #    return True
        #else:  # answer == mb.Cancel
        #    return False
  1. imageData 不再存储 image的信息,减少json存储大小
    找到./python/site-packages/labelme/label_file.py
    imageData=imageData 改为 imageData=None
def save(
        self,
        filename,
        shapes,
        imagePath,
        imageHeight,
        imageWidth,
        imageData=None,
        otherData=None,
        flags=None,
    ):
        if imageData is not None:
            imageData = base64.b64encode(imageData).decode("utf-8")
            imageHeight, imageWidth = self._check_image_height_and_width(
                imageData, imageHeight, imageWidth
            )
        if otherData is None:
            otherData = {}
        if flags is None:
            flags = {}
        data = dict(
            version=__version__,
            flags=flags,
            shapes=shapes,
            imagePath=imagePath,
            # imageData=imageData,
            imageData=None,
            imageHeight=imageHeight,
            imageWidth=imageWidth,
        )
        for key, value in otherData.items():
            assert key not in data
            data[key] = value
        try:
            with open(filename, "w") as f:
                json.dump(data, f, ensure_ascii=False, indent=2)
            self.filename = filename
        except Exception as e:
            raise LabelFileError(e)
  1. image list 列表按照资源管理器进行排序,顺序显示图像
    找到./python/site-packages/labelme/app.py
    首先 import natsort,如果没有安装,可以pip install natsort安装
def scanAllImages(self, folderPath):
        extensions = [
            ".%s" % fmt.data().decode().lower()
            for fmt in QtGui.QImageReader.supportedImageFormats()
        ]

        images = []
        for root, dirs, files in os.walk(folderPath):
           for file in files:
               if file.lower().endswith(tuple(extensions)):
                   relativePath = osp.join(root, file)
                   images.append(relativePath)
        # images.sort(key=lambda x: x.lower())
        images = natsort.natsorted(images)
        return images
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/197702.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • sql触发器

    sql触发器在SQLServer里面也就是对某一个表的一定的操作,触发某种条件,从而执行的一段程序。触发器是一个特殊的存储过程。常见的触发器有三种:分别应用于Insert,Update,Delete事件。我为什

    2022年7月3日
    21
  • UNIX的常用命令

    UNIX的常用命令Unix常用命令介绍:  多命令行:“;”多行命令:“\”1、系统关闭reboot、halt/shutdown、poweroff2、passwd命令:修改系统用户密码passwd[username]3、su命令:切换系统用户su[-username]username为空表示root用户4、cat命令:将指定的文件在标准输出到显示器cat [-AbET] [文件名列表]-A      …

    2022年5月31日
    31
  • sql server2019安装步骤 不支持此版本win10_浏览sql server2019安装介质

    sql server2019安装步骤 不支持此版本win10_浏览sql server2019安装介质SQLServer2019安装步骤文章分为四部分sqlserver安装失败指南(首看,本人下载中遇到的)下载安装sqlserver安装图形化界面ssms创建数据库安装失败以及解决措施下载安装SQLServer进行到第五步时,我这里进行了报错。错误是:thereisaproblemwiththiswindowsinstallerpackage.Aprogramrunaspartofthesetupdidnotfinshasexpectd.

    2022年8月31日
    1
  • J1939TP「建议收藏」

    J1939TP「建议收藏」J1939TP给上层、下层提供的服务,和它本身内部的行为。1939协议定义了一些参数组,每个参数组包含确定的内容和信号。并提供以下PG:负载的长度类型:最大字节数、可变或固定大小参数组号:18位包含以下信息:2bit数据页信息8bitPDU格式8bitPDU细节PF小于240的为PDU1格式,用于点对点通信;大于等于240的为PDU2格式,用于广播通信。PDU细节仅与PDU2格式有关。在PDU1格式下的点对点通信,PS总为0。J1939使用29位CANid作为消…

    2022年5月5日
    39
  • docker 镜像导入导出_镜像导出

    docker 镜像导入导出_镜像导出Docker镜像的导入导出本文介绍Docker镜像的导入导出,用于迁移、备份、升级等场景,准备环境如下:CentOS7.0Docker1.18导入导出命令介绍涉及的命令有export、import、save、loadsave命令dockersave[options]images[images…]示例dockersave-…

    2022年9月16日
    0
  • Nginx 面试 40 问

    Nginx 面试 40 问什么是Nginx?Nginx有哪些优点?Nginx应用场景?Nginx怎么处理请求的?Nginx是如何实现高并发的?什么是正向代理?什么是反向代理?反向代理服务器的优点是什么?Nginx目录结构有哪些?Nginx配置文件nginx.conf有哪些属性模块?cookie和session区别?为什么Nginx不使用多线程?什么是动态资源、静态资源分离?为什么要做动、静分离?什么叫CDN服务?Nginx怎么做的动静分离?Nginx负载均衡的算法..

    2022年10月26日
    0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号