티스토리 뷰

디텍션 모델을 개발하는 사람으로서 coco데이터셋은 한 번 맛봐야겠다.

 

https://github.com/developer0hye/Simple-CenterNet

 

developer0hye/Simple-CenterNet

PyTorch Implementation of CenterNet(Object as Points) - developer0hye/Simple-CenterNet

github.com

위 프로젝트에서 쓸 예정

 

예전에 모 회사의 인턴 면접에서 COCO데이터셋에 이미지가 몇장있는지 물어봤었던 기억이 난다...

 

아래 코드를 참고해야지~

 

https://github.com/wei-yuma/multitrident/blob/master/data/coco.py

 

wei-yuma/multitrident

I combine trident net and refinedet to detect objects of different scales at the same time in one forward propagation - wei-yuma/multitrident

github.com

 

참고하며 구현해보니 위 코드는 좀 문제가 있다. 

 

CLASS를 잘못 정의 해놨다...

 

CLASSES = ('person''bicycle''car''motorcycle''airplane''bus',

                'train''truck''boat''traffic light''fire''hydrant',

                'stop sign''parking meter''bench''bird''cat''dog',

                'horse''sheep''cow''elephant''bear''zebra',

                'giraffe''backpack''umbrella''handbag''tie',

                'suitcase''frisbee''skis''snowboard''sports ball',

                'kite''baseball bat''baseball glove''skateboard',

                'surfboard''tennis racket''bottle''wine glass''cup',

                'fork''knife''spoon''bowl''banana''apple',

                'sandwich''orange''broccoli''carrot''hot dog''pizza',

                'donut''cake''chair''couch''potted plant''bed',

                'dining table''toilet''tv''laptop''mouse''remote',

                'keyboard''cell phone''microwave oven''toaster''sink',

                'refrigerator''book''clock''vase''scissors',

                'teddy bear''hair drier''toothbrush')

 

위처럼 해놓았는데.

 

CLASSES = ('person''bicycle''car''motorcycle''airplane''bus',

           'train''truck''boat''traffic light''fire hydrant',

           'stop sign''parking meter''bench''bird''cat''dog',

           'horse''sheep''cow''elephant''bear''zebra',

           'giraffe''backpack''umbrella''handbag''tie',

           'suitcase''frisbee''skis''snowboard''sports ball',

           'kite''baseball bat''baseball glove''skateboard',

           'surfboard''tennis racket''bottle''wine glass''cup',

           'fork''knife''spoon''bowl''banana''apple',

           'sandwich''orange''broccoli''carrot''hot dog''pizza',

           'donut''cake''chair''couch''potted plant''bed',

           'dining table''toilet''tv''laptop''mouse''remote',

           'keyboard''cell phone''microwave''oven''toaster''sink',

           'refrigerator''book''clock''vase''scissors',

           'teddy bear''hair drier''toothbrush')

 

이게 맞다.

 

애초에 torchvision 에서 coco 데이터셋을 쉽게 처리할 수 있도록 클래스를 짜놓았다.

 

https://pytorch.org/vision/stable/_modules/torchvision/datasets/coco.html

 

torchvision.datasets.coco — Torchvision master documentation

Shortcuts

pytorch.org

 

 

아래는 내가 구현한 코드

 

https://github.com/developer0hye/Simple-CenterNet/blob/main/utils/coco17.py

 

developer0hye/Simple-CenterNet

PyTorch Implementation of CenterNet(Object as Points) - developer0hye/Simple-CenterNet

github.com

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/01   »
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
글 보관함