[data처리]YOLO dataset를 COCO dataset로 convert하기
github.com/Taeyoung96/Yolo-to-COCO-format-converter
Taeyoung96/Yolo-to-COCO-format-converter
Yolo to COCO annotation format converter. Contribute to Taeyoung96/Yolo-to-COCO-format-converter development by creating an account on GitHub.
github.com
출처 :
아나콘다 프롬프트 열고
- conda create -n Yolo-to-COCO python=3.8
- conda activate Yolo-to-COCO
- pip install numpy
- pip install opencv-python
- git clone https://github.com/Taeyoung96/Yolo-to-COCO-format-converter.git
- cd Yolo-to-COCO-format-converter
1. 폴더안의 main에서 튜터리얼폴더의 obj.names랑 main의 classes 리스트랑 일치
2. tutorial 폴더의 train을 내 로컬 폴더에 맞게 바꿔주기
python main.py --path /Users/zzjun/OneDrive/Desktop/coco/Yolo-to-COCO-format-converter/CONE_1_1728/train.txt --output train
python main.py --path /Users/zzjun/OneDrive/Desktop/coco/Yolo-to-COCO-format-converter/CONE_1_1728/train.txt --output train --debug
output train 결과를 jq를 통하여 시인성이 좋게 깔끔하게 정리되게 볼수도있다.
train.json 파일을 확인하면 cone_0.jpg가 image id 0으로 bbox 두개 쳐져있는것을 확인할수있고 쭉 coco data set annotation으로 된다.