rampal-punia / yolov8-streamlit-detection-tracking

Object detection and tracking algorithm implemented for Real-Time video streams and static images.
https://codingmantras-yolov8-streamlit-detection-tracking-app-njcqjg.streamlit.app/
294 stars 126 forks source link

RTSP feed issue #5

Open ktsi opened 1 year ago

ktsi commented 1 year ago

Hi. The detection works fine for YouTube vids but when trying rtsp feed it freezes after about 2 sec. I am watching the feed simultaneously on another pc so I know the feed is up and running. Any ideas?

I am using a Mac M1.

rampal-punia commented 1 year ago

Hi, can you add the error message or any warning at the terminal or at the front end? Or is it stopping abruptly?

ktsi commented 1 year ago

Hi there,

Thanks for getting back. Well the image freezes after about 1 -2 seconds. Strange thing is that the logs freeze at the same time but after a while I see an error message and logs start again and then freeze again. Image on the web app is frozen all the time after the initial working period.

Look at this sample:

0: 384x640 3 persons, 1 tv, 44.4ms Speed: 1.3ms preprocess, 44.4ms inference, 0.4ms postprocess per image at shape (1, 3, 384, 640)

0: 384x640 3 persons, 1 tv, 46.1ms Speed: 1.3ms preprocess, 46.1ms inference, 0.5ms postprocess per image at shape (1, 3, 384, 640)

0: 384x640 3 persons, 1 tv, 46.0ms Speed: 1.3ms preprocess, 46.0ms inference, 0.6ms postprocess per image at shape (1, 3, 384, 640) [h264 @ 0x12763fc20] corrupted macroblock 16 11 (total_coeff=-1) [h264 @ 0x12763fc20] error while decoding MB 16 11

0: 384x640 3 persons, 1 tv, 62.1ms Speed: 4.5ms preprocess, 62.1ms inference, 0.5ms postprocess per image at shape (1, 3, 384, 640)

0: 384x640 3 persons, 1 tv, 62.1ms Speed: 4.3ms preprocess, 62.1ms inference, 0.5ms postprocess per image at shape (1, 3, 384, 640)

0: 384x640 3 persons, 1 tv, 45.4ms Speed: 1.5ms preprocess, 45.4ms inference, 0.5ms postprocess per image at shape (1, 3, 384, 640)

ktsi commented 1 year ago

BTW, I tried with another RTSP feed but I have the same behavior.

rampal-punia commented 1 year ago

Are you trying this on a GPU-assisted system?

The inferencing of a video in this system requires a high-end system with at least 4 GB GPU.

ktsi commented 1 year ago

It's a MacBook Air M1 with 8 gigs of total ram/vram.

rampal-punia commented 1 year ago

👍Yes, you already mentioned that. At my end, I am able to receive the RTSP stream and run detection and tracking.

As you mentioned the error.

0: 384x640 3 persons, 1 tv, 46.0ms Speed: 1.3ms preprocess, 46.0ms inference, 0.6ms postprocess per image at shape (1, 3, 384, 640) [h264 @ 0x12763fc20] corrupted macroblock 16 11 (total_coeff=-1) [h264 @ 0x12763fc20] error while decoding MB 16 11

After the error msgs, it is still performing detections, as here:

0: 384x640 3 persons, 1 tv, 62.1ms Speed: 4.5ms preprocess, 62.1ms inference, 0.5ms postprocess per image at shape (1, 3, 384, 640)

0: 384x640 3 persons, 1 tv, 62.1ms Speed: 4.3ms preprocess, 62.1ms inference, 0.5ms postprocess per image at shape (1, 3, 384, 640)

0: 384x640 3 persons, 1 tv, 45.4ms Speed: 1.5ms preprocess, 45.4ms inference, 0.5ms postprocess per image at shape (1, 3, 384, 640)

So, it is running but the display is not correct... is this what you mean...

ktsi commented 1 year ago

Display is frozen. That is the issue. Since logs indicate it is still detecting, what could be the cause?