美文网首页
mask rcnn训练自己的数据

mask rcnn训练自己的数据

作者: chunleiml | 来源:发表于2019-12-31 17:00 被阅读0次

https://blog.csdn.net/u012746060/article/details/82143285
使用labelme生成自己的数据
https://blog.csdn.net/u012746060/article/details/81871733
其中把labelme生成的json文件转换为需要的文件的程序如下:


***要首先激活labelme环境(conda activate labelme),在labelme环境下运行这个脚本

import os
path = r'C:\Users\g2link\Desktop\标注数据\mask_rcnn_traindata\json'
json_file = os.listdir(path)
for file in json_file:
    print(os.path.join(path,file))
    os.system('cd C:\\Users\\g2link\\Anaconda3\\envs\\labelme\\Scripts\\')
    os.system('labelme_json_to_dataset.exe %s'%os.path.join(path,file))

文件移动,重命名

img_path = ''
to_path = ''
files = os.listdir(img_path)
for file in files:
    file_path = os.path.join(img_path,file)
    os.rename('label.png',file+'.png')
    shutil.copy(os.path.join(file_path,file+'.png'),to_path)
    os.rename(file+'.png','label.png')

相关文章

网友评论

      本文标题:mask rcnn训练自己的数据

      本文链接:https://www.haomeiwen.com/subject/nzfioctx.html