有关深度学习打标签DIY的五种方式

*五种制作Label的方式:

1.CVAT(Open Data Annotation Platform)

  1. 了解
  2. CVAT开放注释平台:https://www.cvat.ai/
    在这里插入图片描述
    此平台由:
    在这里插入图片描述
    共同开发,可以进行图像分类、目标检测、语义和实例分割、点云/雷达、3D立方体、视频注释和骨架等等。
    在这里插入图片描述
  3. 准备开始
  4. 在线:https://app.cvat.ai/tasks?page=1
  5. 离线:
    Installation on Ubuntu
    Installation on Windows 10
    Installation on Mac OS
    (1) 需要邮箱注册:
    在这里插入图片描述
    (2)开始:
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    (补充,Advanced configuration里面包含:数据格式、图像质量、数据集仓库URL等),以手动多边形标注为例:
    在这里插入图片描述在这里插入图片描述
    参考:
    目标检测数据集标注工具 CVAT 使用方法
    使用Amazon SageMaker部署CVAT AI自动图像标注系统

2.EISeg(Efficient Interactive Segmentation)自动标注

代码和论文网址:
https://github.com/PaddlePaddle/PaddleSeg
EISeg: Effective interactive segmentation

  1. 了解
    基于飞桨开发的一个高效智能的交互式分割标注软件。它涵盖了通用、人像、遥感、医疗、视频等不同方向的高质量交互式分割模型。 另外,将EISeg获取到的标注应用到PaddleSeg提供的其他分割模型进行训练,便可得到定制化场景的高精度模型,打通分割任务从数据标注到模型训练及预测的全流程。
    在这里插入图片描述
  2. 安装:
pip install opencv-python==4.5.5.64
pip install opencv-contrib-python==4.5.5.64
pip install opencv-python-headless==4.5.5.64
pip install eiseg

在这里插入图片描述
参考:百度智能语义分割开源软件EIseg新手安装指南
我是安装的PaddlePaddle-gpu、
终端输入:eiseg打开:
下载模型:
在这里插入图片描述
我下载的是:高精度模型,通用图像标注场景,EdgeFlow,static_edgeflow_cocolvis。
然后加载的时候:
在这里插入图片描述
出现错误:OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
不管许多,上解决方式:
代码前加入两行如下代码即可:

import os
os.environ["KMP_DUPLICATE_LIB_OK"]  =  "TRUE"

之后载入一段时间:
在这里插入图片描述
可以正常使用。
因为我需要的是yolo格式的标签文件,但是该eiseg只支持coco和json格式,所以有一个json2txt的python代码参考:

#处理labelme多边形矩阵的标注  json转化txt
#!/usr/bin/ python
# -*- encoding: utf-8 -*-
import json
import cv2
import numpy as np
import glob

def totxt():
        # 第二列:中心归一化横坐标(x)
        # 第三列:中心归一化纵坐标(y)
        # 第四列:归一化宽度(w)
        # 第五列:归一化高度(h)

        height,width = img.shape[0],img.shape[1]
        dw = 1 / width
        dh = 1/ height
        
        with open(out_txt_file, "w+") as f:
            for shape in data:
                points = shape["points"]
                cls_id = shape["labelIdx"]-1
                xmin, ymin, w, h = cv2.boundingRect(np.array(points, dtype=np.int))
                xmax = xmin+w
                ymax = ymin+h

                x = (xmin + xmax) / 2.0 - 1
                y = (ymin + ymax) / 2.0 - 1
                w = xmax - xmin
                h = ymax - ymin
                if w < 50 or h < 50:
                    continue
                x = x * dw
                w = w * dw
                y = y * dh
                h = h * dh
                f.write("%s %s %s %s %s\n"%(cls_id,x, y, w, h))


if __name__=="__main__":
    # 文件列表
    json_list = glob.glob("Annotations/*.json")
    for file in json_list:
        basename = file.split("\\")[-1].split(".")[0]
        # 读取图片
        img = cv2.imread("images/"+basename+".png")
        if img is None:
            continue
        # 读取json文件
        data = ""
        with open(file, 'r', encoding='utf-8') as f:
            data = json.load(f)
      	# yololabels
        out_txt_file = "labels/" + basename + ".txt"
        totxt()

参考:
使用EISeg自动标注数据,yolov5训练模型(保姆教程)
PaddlePaddle/PaddleSeg
PaddleLabel机器学习辅助标注后端
EISeg分割标注软件使用

3.Make Sence在线标注(对Yolo和VOC格式十分友好)

网址:https://www.makesense.ai/
在这里插入图片描述
很好上手:
在这里插入图片描述
标注结束,多边形支持导出VGG Json和COCO Json格式,矩形框支持导出yolo、csv和VOC xml格式。
在这里插入图片描述
在这里插入图片描述

4.LabelImg和Labelme

LabelImg 标注工具:https://github.com/heartexlabs/labelImg
安装LabelImg之前需要安装:

pip install lxml -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install PyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install PyQt5_tools -i https://pypi.tuna.tsinghua.edu.cn/simple

LabelImg 的界面如下所示:
在这里插入图片描述
只能正方形,适合做分类,不太适合做实例分割的数据集标注。LabelImg 可以保存三种数据格式:PASCAL VOC: voc 的xml 格式,yolo 格式和ML格式。
而labelme可以直接安装:

pip install labelme

打开:
在这里插入图片描述

labelme支持多边形操作,只能导出json格式,需要的话,还要进行xml或者txt转换。

**注入json2txt以及json2xml的python脚本(其它的转换脚本持续更新中…)

Python+Matlab+Halcon语言的转换文件合集

***加更:多边形分割之Yolo格式的生成方式

方式1MakeSence在线标注网页
在这里插入图片描述
选择多边形标注,然后选择coco或者vgg格式导出:
在这里插入图片描述
coco格式导出的话,就只有一个.json的文件。

方式2:

EiSeg智能标注软件:
在这里插入图片描述
导出Labelme格式的json和coco格式的json文件,同样,coco格式的文件是一个annotation.json的文件,而labelme是对应每一个的json的文件。

方式3:

labelme直接标注:
在这里插入图片描述
根据方式1-3,利用"JSON2YOLO-master"转换json格式,然后利用txt导入至labels,标签利用segment文件夹中的train.py文件进行训练:
在这里插入图片描述
参考:
Python实例分割 YOLOv5 segment使用教程
全网使用yolov5分割任务最详细教程!!!
yolo实现语义分割(cityscapes数据集)附源码

  • 4
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

心清似水淡若云、

每打赏一元孩子的脸上多一分甜~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值