我被困在這里,我是一個新手,我認為問題在于將數據集轉換為 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
提交
取消