wufan-tb / yolo_slowfast

Yolov5+SlowFast: Realtime Action Detection Based on PytorchVideo
438 stars 55 forks source link

Detection on custom yolo weights #13

Open soumyadbanik opened 1 year ago

soumyadbanik commented 1 year ago

I have a custom trained yolo weights and there the person class is not having 0 class index. How to handle that? As far as I understood you are taking the 0th index and passing it to slowfast_r50, since person class is in 0th index at coco dataset

wufan-tb commented 1 year ago

maybe you can try to change the 66th line in yolo_slowfast.py , form "if int(cls) != 0:" to "if int(cls) != N:", in which N means the index of person class.

soumyadbanik commented 1 year ago

Thanks a lot. It wokred

shizishen commented 1 year ago

How to run it through the computer webcam?

soumyadbanik commented 1 year ago

How to run it through the computer webcam?

You can try with replacing here by video=cv2.VideoCapture(0) #or put your specific camera id

suki1504 commented 1 year ago

ideo=cv2.VideoCapture(0) #or put your specific camera id

python yolo_slowfast.py --input 0

Here " 0 (Zero) " means webcam