본문 바로가기

ML & DL

YOLOv5 / YOLOv7 특정 object(class) 탐지

다음 argument를 설정해줌으로써 특정 object만 탐지할 수 있다.
하나의 클래스 뿐만 아니라 여러 개의 클래스를 필터링 할 수도 있음. 

YOLOv7의 경우 weight값만 변경하여 같은 command로 실행 가능

# example (only person class)
python detect.py --weight yolov5n.pt --source 0 --classes 0

 

 

  • class id는 다음 링크에서 확인 (id 1부터 시작)
 

What Object Categories / Labels Are In COCO Dataset?

One important element of deep learning and machine learning at large is dataset. A good dataset will contribute to a model with good precision and recall. In the realm of object detection in images…

tech.amikelive.com


예시) RK3399 테스트 결과 (Webcam)

 

환경

  • CPU 사용
  • YOLOv5, YOLOv7 모두 pretrained model 중 가장 가벼운 모델 사용
    • YOLOv5: yolov5n.pt
    • YOLOv7: yolov7.pt

 

YOLOv5 (yolov5n)

  • inference time : 1500 ~ 1800ms

YOLOv7 (yolov7)

  • inference time : 8700 ~ 9700ms


Reference