首先单张制作的方法:
1.首先激活labelme环境
conda activate label#我label安装到label环境中,label是环境的名称
2.找到labelme安装路径下的script,找到labelme_json_to_dataset.exe所在目录。
cd F:\Anacondapy3.5\envs\label\Scripts
3.输入
python labelme_json_to_dataset.exe C:\Users\Terry\Desktop\1123123\\11011000001320000005-1-20201012133705-23892182849.json
C:\Users\Terry\Desktop\1123123\\11011000001320000005-1-20201012133705-23892182849.json
上面为文件的路径。不懂绝对路径相对路径请看我另一篇博文。


我们打开是没有yaml文件,只有4个文件。
解决无yaml问题:
https://blog.youkuaiyun.com/winter616/article/details/104426111/
批量制作:
使用脚本的方式
1创建一个py文件(我的是1234.py)
输入如下 :
import os
path = 'C:/Users/Terry/Desktop/shuichi/zhai\\' # path是你存放json的路径
json_file = os.listdir(path)
for file in json_file:
os.system("python F:/Anacondapy3.5/envs/label/Scripts/labelme_json_to_dataset.exe %s"%(path + file))
2.在命令行,打开 labelme环境
3打开1234.py所在目录。然后在命令行输入
python 1234.py


移动图片到指定文件夹
import os
import cv2 as cv
path="C:/Users/Terry/Desktop/shuichi/zhai"
if not os.path.exists(os.path.join(path,"IMAGE_picture")):
os.mkdir(path+"./IMAGE_picture")#./IMAGE_picture如果是这样则会创建一个zhai文件夹下的mulu
os.mkdir(path+"./LABEL_picture")
IMAGE_picture_path=os.path.join(path,"IMAGE_picture")
LABEL_picture_PATH=os.path.join(path,"LABEL_picture")
imgs_name = os.listdir(path)
print(imgs_name)
STR=0
for imgname in imgs_name:
STR=str(STR)
imgs_path=os.path.join(path,imgname)
img_path = os.path.join(

本文详细介绍如何使用Labelme工具进行图像标注,包括单张及批量处理流程,以及如何生成训练所需的图像和标签文件。
最低0.47元/天 解锁文章
2980

被折叠的 条评论
为什么被折叠?



