코드민수
[MS COCO] COCO annotation 포맷 본문
BIG
{
"images": [image],
"annotations": [annotation],
"categories": [category]
}
image = {
"id": int,
"width": int,
"height": int,
"file_name": str,
}
annotation = {
"id": int,
"image_id": int,
"category_id": int,
"segmentation": RLE or [polygon],
"area": float,
"bbox": [x,y,width,height], # (x, y) are the coordinates of the upper left corner of the bbox
"iscrowd": 0 or 1,
}
categories = [{
"id": int,
"name": str,
"supercategory": str,
}]
Object Detection 관련 모델은 대부분 COCO 데이터셋 포맷을 지원하기 때문에
Custom Dataset 사용 시 바운딩 박스 레이블을 COCO 포맷으로 변경해줄 필요가 있습니다.
처음 포맷을 찾아볼 때 bbox의 x, y를 x center, y center 좌표로 설명한 블로그 글을 보고
시행착오를 겪으면서 시간 낭비를 했어서 따로 정리해둡니다.
https://mmdetection.readthedocs.io/en/latest/user_guides/train.html#train-with-customized-datasets
Train predefined models on standard datasets — MMDetection 3.0.0 documentation
Train predefined models on standard datasets MMDetection also provides out-of-the-box tools for training detection models. This section will show how to train predefined models (under configs) on standard datasets i.e. COCO. Prepare datasets Training requi
mmdetection.readthedocs.io
위 json 스크립트는 mmdetection의 가이드 문서에서 발췌하였습니다.
LIST
'[기타]' 카테고리의 다른 글
[Windows] 어쩌다 발견한 유용한 단축키 (작업표시줄 실행 단축키) (0) | 2023.05.07 |
---|---|
[ImageJ] Labkit GPU 활성화 (0) | 2023.04.30 |
[도커] YOLO 환경 구축 시 필요한 라이브러리 및 오류 해결 (0) | 2023.04.25 |
[도커] 도커 이미지 생성, 저장, 실행(리눅스) (0) | 2023.04.22 |
[도커] 윈도우에서 WSL2를 사용하여 도커 설치 (0) | 2023.04.22 |