-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConvertAllToDarknet.py
41 lines (32 loc) · 1.54 KB
/
ConvertAllToDarknet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'''
Convert all the datasets to the darknet format for YOLO
'''
from VOCToDarknet import VOCToDarknet
# KIITI
imageFolder = "/mnt/storage/Machine_Learning/Datasets/KITTI/data_object_image_2/training/image_2"
sourceLabelFolder = "KITTI_Labels/VOCFormat/"
outputImageFile = "KITTI_Labels/imageList.txt"
outputLabelFolder = "KITTI_Labels/DarknetFormat/"
converter = VOCToDarknet(imageFolder,sourceLabelFolder,outputImageFile,outputLabelFolder)
converter.convertDataset()
#AUTTI
imageFolder = "/mnt/storage/Machine_Learning/Datasets/Udacity_self_driving_car/object-dataset"
sourceLabelFolder = "AUTTI_Labels/VOCFormat/"
outputImageFile = "AUTTI_Labels/imageList.txt"
outputLabelFolder = "AUTTI_Labels/DarknetFormat/"
converter = VOCToDarknet(imageFolder,sourceLabelFolder,outputImageFile,outputLabelFolder)
converter.convertDataset()
#CrowdAI
imageFolder = "/mnt/storage/Machine_Learning/Datasets/Udacity_self_driving_car/object-detection-crowdai"
sourceLabelFolder = "CrowdAI_Labels/VOCFormat/"
outputImageFile = "CrowdAI_Labels/imageList.txt"
outputLabelFolder = "CrowdAI_Labels/DarknetFormat/"
converter = VOCToDarknet(imageFolder,sourceLabelFolder,outputImageFile,outputLabelFolder)
converter.convertDataset()
#MIT Street Scenes
imageFolder = "/mnt/storage/Machine_Learning/Datasets/MIT_Street_Scenes/images"
sourceLabelFolder = "MIT_Labels/VOCFormat/"
outputImageFile = "MIT_Labels/imageList.txt"
outputLabelFolder = "MIT_Labels/DarknetFormat/"
converter = VOCToDarknet(imageFolder,sourceLabelFolder,outputImageFile,outputLabelFolder)
converter.convertDataset()