detectron2,手把手教你训练mask_rcnn
弄了好几个月,现在终于能训练自己的数据了。 首先 cuda 10.2 PyTorch 1.3.1 labelme 3.18.0 安装 PyTorch 和 labelme 直接 anaconda 下面 pip 就好,之所以不用 conda ,是因为使用 conda 下 PyTorch 不能使用 cuda , pip 会帮你安装 cudatoolkit=10.2 。 1、使用labelme整理数据 1.1 使用下面代码重命名图片文件,显得专业点。 # -*- coding: utf-8 -*- """ Spyder Editor HGH """ import os import cv2 path_img = r '/images' dirs = os . listdir ( path_img ) os . chdir ( path_img ) try : os . mkdir ( 'rename' ) except : pass count = 0 for img in dirs : img = cv2 . imread ( img , 1 ) Str = "%06d" % count path = os . path . join ( 'rename' , Str + '.jpg' ) cv2 . imwrite ( path , img ) count += 1 可以得 打开