0


PaddleDetect图像目标检测模型训练之数据标注——使用labelme进行标注

0 前言

在做PaddleDetect图像检测模型训练时,需要对数据集进行人工标注,下面将已货车检测为例,使用labelme进行标注的详细过程记录一下,以防日后忘记。

本文中使用到的文件请到这里下载:https://download.csdn.net/download/loutengyuan/87616492

1 labelme环境搭建

labelme是图形图像注释工具,它是用Python编写的,并将Qt用于其图形界面。说直白点,它是有界面的, 像软件一样,可以交互,但是它又是由命令行启动的,比软件的使用稍微麻烦点。其界面如下图:
在这里插入图片描述

注:这里界面我做过汉化,原本是英文的,下面会提供汉化的文件。

1.1 labelme工具安装

请先打开cmd命令窗口,在输入以下命令进行安装:

# -i 是指定国内镜像源,提高安装速度
pip install labelme -i https://mirror.baidu.com/pypi/simple

在这里插入图片描述
查看是否安装可以使用以下命令:

pip list

在这里插入图片描述

1.2 labelme汉化

将labelme汉化文件(下载目录中的app.py文件)替换到以下目录(这里以你实际安装目录为准):

C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Lib\site-packages\labelme

在这里插入图片描述

2 标注操作流程

打开下载文件,可以看到如下文件:

  • truck_detect:待标注图片
  • app.py:labelme汉化文件
  • labels.txt:标注标签列表
  • 双击打开标注工具.bat:启动脚本在这里插入图片描述

2.1 打开标注工具

本来启动labelme软件是通过命令行方式启动的,这里我将这个命令到到 双击打开标注工具.bat 文件中了,所以只需双击这个脚本就能打开labelme工具了,启动脚本内容如下:

:: 进入当前目录
cd  %~dp0
labelme truck_detect --labels labels.txt
pause

2.2 开启自动保存选项

  • 选择 File -> Save Automatically 自动保存选项在这里插入图片描述

新建标注

选择 绘制矩形 或者 绘制多边形 选项
在这里插入图片描述
执行以下步骤,安装标签类型标出图片中各个区域位置,然后点击下一张,所画的区域将自动保存:
在这里插入图片描述

2.3 编辑/修改标注

如果标签选错或者区域要调整,可以点击编辑选择,选中需要编辑的区域进行修改,或者鼠标右键选择 编辑标签 进行修改。
在这里插入图片描述

2.4 标注文件

标注好的文件和图片都保存在 truck_detect 文件夹下:
在这里插入图片描述
标签文件为json格式,内容如下:

{"version":"5.1.1",
  "flags":{},
  "shapes":[{"label":"整车侧面",
      "points":[[96.73611111111113,
          66.625],
        [446.0416666666667,
          290.23611111111114]],
      "group_id": null,
      "shape_type":"rectangle",
      "flags":{}},
    {"label":"车头侧面",
      "points":[[101.59722222222224,
          70.79166666666666],
        [299.5138888888889,
          294.40277777777777]],
      "group_id": null,
      "shape_type":"rectangle",
      "flags":{}},
    {"label":"车轮侧面",
      "points":[[177.29166666666669,
          188.84722222222223],
        [431.45833333333337,
          288.84722222222223]],
      "group_id": null,
      "shape_type":"rectangle",
      "flags":{}},
    {"label":"车身侧面",
      "points":[[290.48611111111114,
          70.79166666666666],
        [439.09722222222223,
          279.125]],
      "group_id": null,
      "shape_type":"rectangle",
      "flags":{}}],
  "imagePath":"81675.jpg_800x533.jpg",
  "imageData":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAFHAeoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AA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HDRbk2NtcCPOOo688jJ459KaUyjIse2VkBKAknhugzz05x7UCKroUcqwwR1FIysFUkYDDI56jOP5irhTIIRVeVVVSCAcDHPHfsPalQArCjKuCrZyBkcnp6Y9qAKIHOO/pTthHzOQF9TVyTy0t/kjbBUbWCDGe+TnJ78VEFkERIQPIGIfKglQMY47d+aAIRIqD5F59SOfypjEscsSTVsoAh+RfJ8vIfAyWx69c54xRlQHAjTCwqw+UZzgc/r9KAKfbFJU1wAJFIAG5FJAGBkgZ4qGgDZ2E0oTHeiigYu2l2iiigBdoFG33oooAULShQaKKAFxRszRRQAoXNLsP+TRRQA7y6UJiiigQuz6UoQAYoooAXaKMCiigBaKKKADFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUANLAVGz0UUARM57VGz4Bx3GDRRQMiZ8dKjZ2JHPQYFFFACecyk4Zh64PWmtK7dWJ4xyaKKAGu7MfmYk+5zUZNFFACE00miigQ0tmkzmiigAxS4B60UUABYA4AppJPJ6elFFABRRRQAUUUUAFJRRQB//9k=",
  "imageHeight":327,
  "imageWidth":490}

3 格式转换

常用的目标检测数据集有两种格式,分别是VOC和COCO。

3.1 转COCO格式

如果使用COCO格式,建议使用PaddleDetection中的x2coco将标注好的文件转为COCO格式的数据集。转换代码如下:

python tools/x2coco.py \
                --dataset_type labelme \
                --json_input_dir ./labelme_annos/ \
                --image_input_dir ./labelme_imgs/ \
                --output_dir ./cocome/ \
                --train_proportion 0.8\
                --val_proportion 0.2\
                --test_proportion 0.0

3.2 转VOC格式

本项目使用VOC格式的数据集,使用下面代码将数据集转成VOC2007格式:

import os
import numpy as np
import codecs
import json
from glob import glob
import cv2
import shutil

# 标签路径
labelme_path ="D:/DataProcess/vehicle/truck_detect/truck_detect/"# 原始labelme标注数据路径
saved_path ="D:/DataProcess/vehicle/truck_detect/truck_detect_voc/"# 保存路径# 将中文标签名称转换成英文字母
label_translate_dict ={"车头正面":"head_front",
    "车头侧面":"head_side",
    "车身侧面":"body_side",
    "车轮侧面":"wheel_side",
    "整车侧面":"vehicle_side",
    "工程车":"vehicle_side"# engine_truck}

label_txt =["__ignore__", "_background_"]# 创建要求文件夹if not os.path.exists(saved_path + "Annotations"):
    os.makedirs(saved_path + "Annotations")if not os.path.exists(saved_path + "JPEGImages/"):
    os.makedirs(saved_path + "JPEGImages/")# 获取待处理文件
files = glob(labelme_path + "*.json")
files =[i.split("\\")[-1].split(".json")[0]foriin files]
total_len = len(files)
total_idx =0

out_count =0
skip_count =0
err_count =0# 读取标注信息并写入 xmlforjson_file_in files:
    total_idx +=1if" "in json_file_:
        continue
    json_filename = labelme_path + json_file_ + ".json"
    img_filename = labelme_path + json_file_ + ".jpg"if not os.path.exists(json_filename) or not os.path.exists(img_filename):
        continue
    json_file = json.load(open(json_filename, "r", encoding="utf-8"))if total_idx % 100==0:
        print("进度:{}".format((total_idx / total_len)*100))

    imagePath = json_file["imagePath"]if json_file_ not in imagePath:
        err_count +=1
        print("imagePath error fileName = {}    imagePath = {}".format(json_file_, imagePath))continue

    height, width, channels = cv2.imread(img_filename).shape
    success_count =0
    xml_filename = saved_path + "Annotations/" + json_file_ + ".xml"
    with codecs.open(xml_filename, "w", "utf-8") as xml:
        xml.write('<annotation>\n')
        xml.write('\t<folder>' + 'UAV_data' + '</folder>\n')
        xml.write('\t<filename>' + json_file_ + ".jpg" + '</filename>\n')
        xml.write('\t<source>\n')
        xml.write('\t\t<database>The UAV autolanding</database>\n')
        xml.write('\t\t<annotation>UAV AutoLanding</annotation>\n')
        xml.write('\t\t<image>flickr</image>\n')
        xml.write('\t\t<flickrid>NULL</flickrid>\n')
        xml.write('\t</source>\n')
        xml.write('\t<owner>\n')
        xml.write('\t\t<flickrid>NULL</flickrid>\n')
        xml.write('\t\t<name>ChaojieZhu</name>\n')
        xml.write('\t</owner>\n')
        xml.write('\t<size>\n')
        xml.write('\t\t<width>' + str(width) + '</width>\n')
        xml.write('\t\t<height>' + str(height) + '</height>\n')
        xml.write('\t\t<depth>' + str(channels) + '</depth>\n')
        xml.write('\t</size>\n')
        xml.write('\t\t<segmented>0</segmented>\n')formultiin json_file["shapes"]:
            points = np.array(multi["points"])
            xmin = min(points[:, 0])
            xmax = max(points[:, 0])
            ymin = min(points[:, 1])
            ymax = max(points[:, 1])if"未知"in multi["label"]:
                breakforkeyin label_translate_dict.keys():
                if key in multi["label"]:
                    label = label_translate_dict[key]breakif label is None:
                continueif label not in label_txt:
                label_txt.append(label)if xmax <= xmin:
                continueelif ymax <= ymin:
                continueelif(xmax - xmin) * (ymax - ymin)<1000:
                continue
            else:
                xml.write('\t<object>\n')
                xml.write('\t\t<name>' + label + '</name>\n')
                xml.write('\t\t<pose>Unspecified</pose>\n')
                xml.write('\t\t<truncated>1</truncated>\n')
                xml.write('\t\t<difficult>0</difficult>\n')
                xml.write('\t\t<bndbox>\n')
                xml.write('\t\t\t<xmin>' + str(xmin) + '</xmin>\n')
                xml.write('\t\t\t<ymin>' + str(ymin) + '</ymin>\n')
                xml.write('\t\t\t<xmax>' + str(xmax) + '</xmax>\n')
                xml.write('\t\t\t<ymax>' + str(ymax) + '</ymax>\n')
                xml.write('\t\t</bndbox>\n')
                xml.write('\t</object>\n')# print(total_idx, total_len, json_filename, xmin, ymin, xmax, ymax, label)
                success_count +=1
        xml.write('</annotation>')if success_count >0:
        shutil.copy(img_filename, saved_path + "JPEGImages/")
        out_count +=1
    else:
        skip_count +=1if os.path.exists(xml_filename):
            os.remove(xml_filename)# 写标签文件
labels_txt_writer = open(saved_path + '/labels.txt', 'w')fortextin label_txt:
    labels_txt_writer.write(text + "\n")
labels_txt_writer.close()

print("-------------------------------- Finished  --------------------------------")
print("out_count = {}".format(out_count))
print("skip_count = {}".format(skip_count))
print("err_count = {}".format(err_count))
print("label_txt = {}".format(label_txt))

3.3 输出标注区域

下面这个脚本是用于将标签json文件解析,并将结果单独裁剪或绘制到图像中,用于查看标注效果:

import os
import numpy as np
import json
from glob import glob
import cv2
from PIL import Image, ImageDraw, ImageFont

labelme_path ="D:/DataProcess/vehicle/truck_detect/truck_detect/"# 原始labelme标注数据路径# 输出文件夹路径
outputPath ="D:/DataProcess/vehicle/predict_output/"

files = glob(labelme_path + "*.json")
files =[i.split("\\")[-1].split(".json")[0]foriin files]
files_size = len(files)# 将区域裁剪单独保存
def clip_save():
    file_idx =0forjson_file_in files:
        file_idx +=1if" "in json_file_:
            continue
        json_filename = labelme_path + json_file_ + ".json"
        img_filename = labelme_path + json_file_ + ".jpg"if not os.path.exists(json_filename) or not os.path.exists(img_filename):
            continue
        json_file = json.load(open(json_filename, "r", encoding="utf-8"))# image = cv2.imread(img_filename)
        image = cv2.imdecode(np.fromfile(img_filename, dtype=np.uint8), -1)# height, width, channels = image.shape# "车头正面", "车头侧面", "车身侧面", "车轮侧面", "整车侧面", "工程车"forlabel_namein["车头正面", "车头侧面"]:
            outputLabelPath = outputPath + label_name + "/"if not os.path.exists(outputLabelPath):
                os.makedirs(outputLabelPath)
            idx =0formultiin json_file["shapes"]:
                points = np.array(multi["points"])
                xmin = min(points[:, 0])
                xmax = max(points[:, 0])
                ymin = min(points[:, 1])
                ymax = max(points[:, 1])#     "车头正面", "车头侧面", "车身侧面", "车轮侧面", "整车侧面"
                label = multi["label"]if label_name not in label:
                    continueif xmax <= xmin:
                    continueelif ymax <= ymin:
                    continueelif(xmax - xmin) * (ymax - ymin)<1000:
                    continue
                else:
                    print("{}/{} {} {} {} {} {} {}".format(file_idx, files_size, json_filename, xmin, ymin, xmax, ymax,
                                                           label))# 将主体区域裁剪后保存到输出文件夹 #参数1 是高度的范围,参数2是宽度的范围
                    img_crop = image[int(ymin):int(ymax), int(xmin):int(xmax)]if idx ==0:
                        out_image_file = outputLabelPath + json_file_ + ".jpg"
                    else:
                        out_image_file = outputLabelPath + "crop_" + str(idx) + "_" + json_file_ + ".jpg"# cv2.imwrite(out_image_file, img_crop)
                    cv2.imencode('.jpg', img_crop)[1].tofile(out_image_file)

                    idx +=1# 将结果绘制到一张图片
def draw_save():
    file_idx =0forjson_file_in files:
        file_idx +=1if" "in json_file_:
            continue
        json_filename = labelme_path + json_file_ + ".json"
        img_filename = labelme_path + json_file_ + ".jpg"if not os.path.exists(json_filename) or not os.path.exists(img_filename):
            continue
        json_file = json.load(open(json_filename, "r", encoding="utf-8"))# image = cv2.imread(img_filename)
        image = cv2.imdecode(np.fromfile(img_filename, dtype=np.uint8), -1)[:, :, ::-1]if isinstance(image, np.ndarray):
            image = Image.fromarray(image)# height, width, channels = image.shape
        is_success = False
        formultiin json_file["shapes"]:
            points = np.array(multi["points"])
            xmin = min(points[:, 0])
            xmax = max(points[:, 0])
            ymin = min(points[:, 1])
            ymax = max(points[:, 1])#     "车头正面", "车头侧面", "车身侧面", "车轮侧面", "整车侧面"
            label = multi["label"]
            tag = False
            fortextin["车头正面"]:
                if text in label:
                    tag = True
                    breakif not tag:
                continueif xmax <= xmin:
                continueelif ymax <= ymin:
                continue
            else:
                is_success = True
                print("{}/{} {} {} {} {} {} {}".format(file_idx, files_size, json_filename, xmin, ymin, xmax, ymax,
                                                       label))
                draw = ImageDraw.Draw(image)
                font_size =36# simfang.ttf 这个文件在下载包中有
                font = ImageFont.truetype("./simfang.ttf", font_size, encoding="utf-8")
                text ="标签:{}".format(multi["label"])
                th = font_size
                tw = font.getsize(text)[0]# tw = int(len(result["rec_docs"]) * font_size) + 60
                start_y = max(0, ymin - th)

                draw.rectangle([(xmin + 1, start_y), (xmin + tw + 1, start_y + th)], fill=(0, 102, 255))

                draw.text((xmin + 1, start_y), text, fill=(255, 255, 255), font=font)

                draw.rectangle([(xmin, ymin), (xmax, ymax)], outline=(255, 0, 0), width=2)if is_success:
            # image.show(img_filename)

            os.makedirs(outputPath, exist_ok=True)
            output_path = os.path.join(outputPath, json_file_ + ".jpg")

            image.save(output_path, quality=95)if __name__ =='__main__':# 将结果单独裁剪保存
    clip_save()# # 将结果绘制到同一张图片上保存# draw_save()

本文转载自: https://blog.csdn.net/loutengyuan/article/details/129751419
版权归原作者 Lois_Luo 所有, 如有侵权,请联系我们删除。

“PaddleDetect图像目标检测模型训练之数据标注——使用labelme进行标注”的评论:

还没有评论