-
Notifications
You must be signed in to change notification settings - Fork 399
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
Reduce duplicate calculations by caching metrics to disk (replacement for load_from_csv
)
#342
Comments
I am seeing in the deprecation commit the notes:
Is this seeking alternative something that I can already use, please (and how?), or am I better (in the current moment) to use |
Mm, reading How could I use that new skip/seek trick, based on saved CSV of the stats, please? |
@jucor The main reason for removing this feature was that it just wasn't well thought out before I introduced it - it became very difficult to scale the CSV format as a cache for detector calculations as the number of dimensions/parameters per detector rose. This led to a bunch of weird bugs and edge cases that for a long time went unnoticed, so felt it was time to rework how this caching happens. The latest version made a lot of performance improvements to scanning - are you disabling downscaling in your case, or is most of the time processing the video spent just decoding each frame? I do apologize for the current status quo regarding loading/caching frame metrics. Removing it was necessary to allow customizing the calculation of each frame's score from the component weights. In the long term, I want to look into having each detector itself be responsible for caching calculations, and reserve the statsfile purely for statistical/human readable analysis. That was the intended purpose, but it kind of unravelled when attempting to re-use the same format as a cache for detection calculations. |
Regarding seeking/skipping, I don't think that applies for your particular use case since you want to re-process the entire video. Instead it might be worth just hacking a ContentDetector to load frame scores from a specified CSV file instead of calculating them. I do apologize for this making things slower for you in the interim - if you end up making any progress on that, feel free to submit a PR for it, we did something similar for using the output of You could do this pretty easily by creating a new detector that derives from ContentDetector, and override the In the long run, I think you raise some great points. I want to look into having ContentDetector allow specifying a file to use as a cache, just not sure what the correct format would be. The statsfile would effectively be derived from the cache, instead of being the cache. Thanks for filing this! |
load_from_csv
)
Please don't apologize! It's a terrific tool :) :) |
Taking a look at this with a fresh set of eyes it's probably unwise to pursue re-adding this until a well thought out API is in place. The issue is how the current interface for a Edit: thanks for your the feedback as well on this @jucor, much appreciated. |
Pleasure! Thanks for the hard work and for keeping thinking about it. Makes sense to prioritize as you did :) |
Hi!
Thanks for a great pacakage.
I notice that
StatsManager.load_from_csv
now has a deprectation warning. What is now the recommended way to avoid re-running the costly (20 minutes on my 1h20 x265 video) scene detection, please?I have a stats file created with the CLI:
and I would like to load that
adaptative-stats.csv
file into aSceneManager
to do the actual scene detection.load_from_csv
sounded promising :)Thanks for any help, and a great tool!
Environment:
The text was updated successfully, but these errors were encountered: