AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.75k stars 7.96k forks source link

multiple camera for object detection concurrently #1205

Open WZRPW opened 6 years ago

WZRPW commented 6 years ago

hi there, it seems that Darknet was coded to run the object detection for one camera. I wonder if any suggestion could be provided to run the object detection in case of multiple cameras. Running several individual programs of Darknet.exe will be very costly due to the overhead of CPU resources. It may have to update the current Darknet code to allow the concurrent object detection for each camera. Thanks for all thoughts and discussions on this.

David

AlexeyAB commented 6 years ago

@Iamthegeekdavid Hi,

Running several individual programs of Darknet.exe will be very costly due to the overhead of CPU resources.

I think multi-camera support will have the same cost as running several individual programs of Darknet.exe.

WZRPW commented 6 years ago

@AlexeyAB , wouldn't it save the memory resource with multiple-camera concurrently running in one process?

At least YOLO weight file will be shared among multi-cameras.

dolphinking commented 6 years ago

Nice topic, the same issue we've met during the project implementation

qunsorber commented 6 years ago

@Iamthegeekdavid @AlexeyAB I want to accomplish the same task. one of the solutions I think it works is that we can combine two images, for example from different cameras, into one and separate them with the results after detection. I'm trying to achieve this. On the other hand, I am not sure if it's useful to change the batch. Is it possible to get the results of two images once by setting the batch=2 ? https://github.com/AlexeyAB/darknet/blob/c2a8cc2ad3f4b31243cbf577440ee45bafcc7f92/src/demo.c#L143

AlexeyAB commented 6 years ago

@qunsorber @Iamthegeekdavid @dolphinking Batch processing during test isn't implemented yet.

You just can write your code for multi-camera detection by using this example: https://github.com/AlexeyAB/darknet/blob/master/src/yolo_console_dll.cpp that uses darknet.dll/darknet.so library, that has this API: https://github.com/AlexeyAB/darknet/blob/master/src/yolo_v2_class.hpp

For SO/DLL creation:

coolmatt1024 commented 5 years ago

@qunsorber I anm doing the same thing with you. I wonder whether it is useful to combine two pictures into one. So, have you gotten the result?

qunsorber commented 5 years ago

@coolmatt1024 Yes, you can do like that, actually I think you can combine the four into one, and the limit is four.