Using a RTSP-Stream or a M3U8 Stream with Object-Detection

The great scientists of the Honkong Multimedia-Laboratory have this great Project for Image-Recognition in place:

https://github.com/open-mmlab/mmdetection

You don’t need much to test it on your own device; Install it like it is described in their fine documentation. https://mmdetection.readthedocs.io/en/latest/INSTALL.html

But there is one thing you can change – 
under /mmdetection/demo change the following lines in the file:
webcam_demo.py

parser.add_argument('--camera-id', type=int, default=0, help='camera device id')

to

parser.add_argument('--camera-id' help='camera device id')

When youre done – you need to download one of the „Models“ (https://mmdetection.readthedocs.io/en/latest/MODEL_ZOO.html) – this are precalculated Nets and „ready-to-use“; For this example i did choose a retinanet-50 Model. Put the 140MB File somewhere readable and then you can for exampel use your Netatmo-Cam to observe live recognition of the objects:This works because the used OpenCV Framework supports not only direct attached hardware devices rather than also RTSP (didn’t test it so) and M3U8 Streams (tested). (Look-up documentation on camera = cv2.VideoCapture(args.camera_id))

python3 webcam_demo.py --camera-id http://Camera-IP/*secret*/live/index.m3u8 ../configs/retinanet_r50_fpn_1x.py retinanet_r50_fpn_2x_20190616-75574209.pth

So check – if you want to use other Models – that config-Model and PTH-File-Model match.

Using a RTSP-Stream or a M3U8 Stream with Object-Detection