-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created headless detector test phase with JSON predictions and bounding boxes for every input image; all outputted to single JSON file #1939
base: master
Are you sure you want to change the base?
Conversation
…or complete headless operation with input and output file locations
…or complete headless operation with input and output file locations
added new command line detector test_headless explanation in readme
would this also work with videos? I am looking for a similar json output for analysing video streams. |
Sorry i responded a bit to quickly. I dont think it will work out of the box. Test_headless expects an input file of images. You could split up the video into separate frames and feed them via the input file. That would work. But a direct feed not im afraid |
…error i encountered on certain images
Updated the stb libraries to newer version, and started using stbi_assert instead of default assert. |
I would also love to see a video or stream being output in json. Just like the webserver stream where you push out json arrays. It would actually complete my current usecase. |
@haviduck It will be launched as server. So you can connect to the port |
Sorry for my bad explanation. As of right npw we do get a stream of good json im a browser when parsing a video. However, instead of streaming it id love to be able to store that entire array in a named json file. Regardless, thank u for a truly great repo |
… on assert failure
restore cpp compatibility
This is loosely based on daltskin's fork, which outputted json data per image, but it turned out it wasn't really valid json and missed the file name information within the json structure.
My need is to bulk process images, with an input file (containing image-paths) and output detections for every image to a single JSON file, which we can then process with other tooling.
Furthermore I wasn't really pleased with the stdin implementation of feeding files and the overhead of having to perform the 'load the alphabet' and 'save predictions to image' steps which I don't need in my pipeline.
Therefore I created a new test phase: test_headless which takes a names file, cfg file and weights file, with an input file (with image paths) and output json file, like so:
./darknet detector test_headless data/openimages.names cfg/yolov3-openimages.cfg ../yolov3-openimages.weights -in_filename input.txt -out_filename output.json
I would love to see this merged in your fork as I think it will be useful for others.
Let me know If I need to make further changes to the code, I tried to keep it as clean as possible without having to adjust existing code:
example output for one image: