Skip to content

Tutorial

RangerOnMars edited this page Nov 18, 2022 · 3 revisions

sjtu2coco-armor.py

Step.1 Create Directory

mkdir images && mkdir labels

Step.2 Check your SJTU format dataset

Move all of your images into images folder,and all of your txt annotations into labels folder.

Step.3 Create classes.txt

gedit classes.txt

Write all classes into it like this:

BG
B1
B2
B3
B4
B5
BO
BB
RG
R1
R2
R3
R4
R5
RO
RB
NG
N1
N2
N3
N4
N5
NO
NB
PG
P1
P2
P3
P4
P5
PO
PB

Attention:We are now using editted SJTU-Format Dataset,which only holds 32 classes,if you want to use original SJTU-Format Dataset,Do write name of all 36 classes into the file!!!

Step.4 Run this script

python3 sjtu2coco-armor.py --root_dir /home/rangeronmars/Pictures/dataset/yolo --random_split

COCO annotations will be saved in annotations folder.