Conversion of Dataset from Darknet Format into Supervisely Format via Python
This repository shows a quick method to convert the dataset in the Darknet format into the JSON-based format required by Supervisely annotation tool in python language. Check it out!
Clone the repository to your local path:
git clone https://github.com/JinhangZhu/darknet-to-supervisely.git
Copy the convert.py
file into your local folder where the darknet dataset is located. Open the terminal on Linux or command window in Windows and run command like:
python convert.py -o ./ego-hand -p ./new-project -d new-set -l left_hand -l right_hand
help:
-o
,--origin
: The name of original data downloaded from Supervisely.type=str
-p
,--project
: The name of the output dataset folder.type=str
-d
,--dataset
: The name of the meta file of the data.type=str
-l
,--label
: Whether to randomly split image set.action='append'
For example, I have a folder called: "ego-hand" in the current path, I want to create a dataset folder called "epichands" under the directory of project "epichhands", with labels: left_hand
, right_hand
. I run:
python convert.py -o ./ego-hand -p ./epichands -d epichands -l left_hand -l right_hand
Namespace(dataset='epichands', label=['left_hand', 'right_hand'], origin='./ego-hand', project='./epichands')
Images: 3%|██▌ | 415/12846 [00:13<06:29, 31.90it/s]
Results:
└───datasets
├───ego-hand
├───epichhands
├───meta.json
├───ann
├───xxx.jpg.json
├───img
├───xxx.jpg
|