-
Notifications
You must be signed in to change notification settings - Fork 27
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
[feature] store detections and use detections file #39
Comments
That's a nice idea (probably ), and it shouldn't be too hard either. As long as you run the same video anyway you don't even have to store indices, you can probably just read them all one by one since frames and detections should be synced up. Pickle works fine with Detections, something simple like
you could, for example, save one detection result. You can also put them all in a big list and then pickle them, it works fairly effortlessly. I'll look into it in the future! |
today I looked into storing the detection-mask in separate color-channels, and i noticed that when i crank the threshold all the way down to 0 the time per frame (for my CPU etc.) is about 13sec. compared to 1.1sec with a threshold of 0.2. (worth noting that the threshold has this kind of effect on run-time) so the threshold should also be stored, or an output-filename and or input-filename needs to be specified for the stored detections. |
Detections (tracked boxes) are stored in a fairly simple JSON format here: #87 Reading them back in would be fairly simple too, I can add that later. In the end, all detections/tracks are just pandas data frames now. |
Do you also store the settings used to generate the detections? I'd appreciate an example for the json as reference here. |
So far only the detections/tracks are stored. An extract of a simple example for a short testing file I'm running:
|
Ok, I think a bit of metadata for the file used can't hurt. Thinking of stopping the program mid-execution, when does the JSON get stored to file? |
That's actually a bit tricky, since the detection scores kind of lose their meaning after (this sort of) tracking. Storing the detection results and the tracking results separately wouldn't be an issue at all though, and including the scores there would make total sense. I'll add this for the next feature then, as follows:
|
While developing, I run the same file over and over again with different options.
I think it would be good if there is an option to export and import the detections.
That way I can run different settings fast without needing to wait on detections each time again and again.
If possible this could also be done via some temporary file-name on-the-fly without an option.
Such that if the hash of the file, its size, last modified date or absolute path is the same you can append to the detections, and reuse them with different settings in case the process fails or is aborted.
I do not know how the detections are stored before they are made into bounds objects, and i do not know how to serialize them into a file to be read later on.
this probably needs some metadata like frame-number and filename etc. for each temp-file.
also there should be some process to get rid of these temp-files, otherwise i worry they might spam someone's hard drive if they automate blurring clips for video production.
The text was updated successfully, but these errors were encountered: