我被困在这里,我是一个新手,我认为问题在于将数据集转换为 yolov4 格式,因为我使用了这段代码:import osimport randomimgspath = 'C:/yolo_v4/yolo_v4_mask_detection/darknet/build/darknet/x64/data/obj'path = 'data/obj/'images = []for i in os.listdir(imgspath): temp = path+i images.append(temp)# train and test split... adjust it if necessarytrainlen = round(len(images)*.80)testlen = round(len(images)*.20)#print('total, train, test dataset size -',trainlen+testlen,trainlen,testlen)random.shuffle(images)test = images[:testlen]train = images[testlen:]with open('train.txt', 'w') as f: for item in train: f.write("%s\n" % item)with open('test.txt', 'w') as f: for item in test: f.write("%s\n" % item)我认为这个程序是错误的任何帮助将不胜感激。
添加回答
举报
0/150
提交
取消