stephanecharette / DarkPlate

License plate parsing using Darknet and YOLO
MIT License
59 stars 11 forks source link

Multiple video source #5

Closed MichaelBryce90 closed 2 years ago

MichaelBryce90 commented 2 years ago

Good day! Thank you very much for the tool, it is very useful and necessary! How can I run multiple video sources?

Or at least how can you run the code with the rtsp camera?

P.S Please make a donation button on the channel so that we can support you! Thanks again)

stephanecharette commented 2 years ago

What do you mean "multiple video sources"?

See this code here: https://github.com/stephanecharette/DarkPlate/blob/master/src/main.cpp#L210-L230 This is where the video stream is opened, and then each frame is fed into the detection. If you're reading from a camera stream, you'd replace this code. Change the output.open() to instead open the RTSP stream, or change where each frame is read from at line 219.

There is a "sponsor" button if you want to donate.

MichaelBryce90 commented 2 years ago

Что вы имеете в виду «несколько источников видео»?

Смотрите этот код здесь: https://github.com/stephanecharette/DarkPlate/blob/master/src/main.cpp#L210-L230 Здесь открывается видеопоток, а затем каждый кадр передается на обнаружение. Если вы читаете из потока камеры, вы должны заменить этот код. Измените, output.open()чтобы вместо этого открыть поток RTSP, или измените место чтения каждого кадра в строке 219.

Есть кнопка «спонсор», если вы хотите сделать пожертвование.

Thanks for the answer! I meant the launch of several video streams or video recordings with this model at once to display the results on the screen at the same time.

stephanecharette commented 2 years ago

Yes, you can run multiple videos at once by launching multiple copies of DarkHelp. But each DarkHelp instance only loads 1 neural network at a time. So you'd have to either launch multiple copies of DarkHelp, or use a mutex to serialize access to the DarkHelp instance.

Probably easier to launch multiple instances since they don't take up much memory.

MichaelBryce90 commented 2 years ago

Yes, you can run multiple videos at once by launching multiple copies of DarkHelp. But each DarkHelp instance only loads 1 neural network at a time. So you'd have to either launch multiple copies of DarkHelp, or use a mutex to serialize access to the DarkHelp instance.

Probably easier to launch multiple instances since they don't take up much memory.

Yes thank you! I really need to figure this out. And one more last question. How can I get rid of the following error?

license plate: B93E15226254E358AE154 [76%] ERROR: OpenCV (4.2.0) ../modules/core/src/matrix.cpp:465: error: (-215: Assertion failed) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function 'Mat'

Usually the length of my number is from 7 to 8 symbols. After some prediction, I get this error.

stephanecharette commented 2 years ago

Can you send me the video/image and neural network that produces this error?

This is caused by having a RoI (region-of-interest) that is beyond the edge of the image. Is this happening in the DarkPlate code, or your own custom code?

MichaelBryce90 commented 2 years ago

Can you send me the video/image and neural network that produces this error?

This is caused by having a RoI (region-of-interest) that is beyond the edge of the image. Is this happening in the DarkPlate code, or your own custom code?

This happens in the DarkPlate code. I have sent a link with files to your mail. Did you receive the letter? I also clarify that the problem is repeated only in some videos.

I added a video where this happens.

MichaelBryce90 commented 2 years ago

Thank you very much! You helped me solve the problem!