Open
Conversation
Not intended for general use. Please, keep in mind the following important known issues: - Detections are still extremely slow. The main reason is that the image supplied to Darknet is created by iterating through the Python numpy array. - Labels are assumed to be Coco. - Labels are read from data files copied from the Darknet distribution, and then supplied to the darknet library. However, the GUI still uses the same data files used throughout the project. We should reuse those files instead of keeping separate copies. - Some hardcoded paths and values. To test YOLOv3-tiny, please follow these steps: 0. Download and compile Darknet to obtain libdarknet.so. 1. Copy yolov3-tiny.cfg from the Darknet distribution into Net/Darknet. 2. Download yolov3-tiny.weights and place it into Net/Darknet. 3. Update your DYLD_LIBRARY_PATH to include the directory where libdarknet.so resides. 4. Run the objectdector as usual, using the yml configuration file in this revision. Other models are possible. The corresponding darknet weights and configuration files must be placed in the Net/Darknet directory. They must have the same name (except for the extension), which must in turn match the Model name defined in the YAML configuration file. I plan to work on speed next. As mentioned above, libdarknet requires an image structure that is manually built from a Python numpy array. I tried to supply a pointer to the underlying Python array instead, but I didn't know how to make it work using ctypes. I'm concerned that the byte ordering will differ anyway. It would be trivial to create a public helper function in libdarknet, but I don't want to depend on patched versions of Darknet. Credits - All data files have been taken from the Darknet distribution. - The darknet.py file was copied from the Darknet distribution, but it includes modifications to trigger detection from a numpy image instead of a file. Part of JdeRobot#38
… of iterating. Speed is much faster, as expected. Part of JdeRobot#38
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main tasks include:
The current version works, but it assumes Coco labels and loads a separate metadata file with Coco categories taken from the Darknet distribution. I'll be updating this PR as I work on the improvement tasks above.
To test
YOLOv3-tiny, please follow these steps:libdarknet.so.yolov3-tiny.cfgfrom the Darknet distribution intoNet/Darknet.yolov3-tiny.weightsand place it intoNet/Darknet.DYLD_LIBRARY_PATHto include the directory wherelibdarknet.soresides.ymlconfiguration file supplied in this PR.Other models are possible. The corresponding darknet weights and configuration files must be placed in the
Net/Darknetdirectory. They must have the same name (except for the extension), which must in turn match the Model name defined in the YAML configuration file.Credits
darknet.pyfile was also copied from the Darknet distribution, but it includes modifications to trigger detection from anumpyimage instead of a file.