dbolya / yolact

A simple, fully convolutional model for real-time instance segmentation.
MIT License
5.03k stars 1.32k forks source link

Support for http(s) and rtsp(s) streams #519

Open ArVar opened 4 years ago

ArVar commented 4 years ago

Is there a way to perform object detection on streams from IP cameras (http & rtsp) directly? Since OpenCV is capable of, it should be possible somehow, shouldn't?

suchiz commented 4 years ago

I think it is. I didn't try thought. But here it is: https://github.com/akmamun/camera-live-streaming. I think you just have to run the model on the frame before stacking them into stream batch. And you should be good ... I might give a try too. It looks interesting

areebsyed commented 4 years ago

Is there a way to perform object detection on streams from IP cameras (http & rtsp) directly? Since OpenCV is capable of, it should be possible somehow, shouldn't?

Yes just in the eval.py on line 644 after the line 643: if is_webcam:

just enter the rtsp url in the brackets after VideoCapture like following:

vid = cv2.VideoCapture('rtsp://userid:password@123.123.123.12:123/Streaming/Channels/123/')

and then run the command: python eval.py --trained_model=weights/yolact_base_54_800000.pth --score_threshold=0.15 --top_k=15 --video_multiframe=4 --video=0

worked for me!