Skip to content
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

--time_sample=5 not giving expected results #148

Closed
PetervanLunteren opened this issue Nov 20, 2024 · 1 comment
Closed

--time_sample=5 not giving expected results #148

PetervanLunteren opened this issue Nov 20, 2024 · 1 comment

Comments

@PetervanLunteren
Copy link
Contributor

I'm having trouble with the --time_sample argument. I'm probably doing something wrong... See the commands below. See my email if you want to test on the exact same video.

--time_sample=5

Expected: process only one frame every 5 seconds
Result: processes all 385 frames

'/Applications/.EcoAssist_files/miniforge/envs/ecoassistcondaenv-base/bin//python' '/Applications/.EcoAssist_files/cameratraps/megadetector/detection/process_video.py' '--json_confidence_threshold=0.01' '--recursive' '--time_sample=5' '--frame_folder=/Users/peter/Downloads/temp' '--keep_extracted_frames' '--max_width=1280' '--quality=85' '--output_json_file=/Users/peter/Downloads/single-sp/video_recognition_file.json' '/Applications/.EcoAssist_files/models/det/MegaDetector 5a/[md_v5a.0.0.pt](http://md_v5a.0.0.pt/)' '/Users/peter/Downloads/single-sp'

--time_sample=0.5

Expected: process only one frame every 0.5 seconds
Result: processes all 385 frames

'/Applications/.EcoAssist_files/miniforge/envs/ecoassistcondaenv-base/bin//python' '/Applications/.EcoAssist_files/cameratraps/megadetector/detection/process_video.py' '--json_confidence_threshold=0.01' '--recursive' '--time_sample=0.5' '--frame_folder=/Users/peter/Downloads/temp' '--keep_extracted_frames' '--max_width=1280' '--quality=85' '--output_json_file=/Users/peter/Downloads/single-sp/video_recognition_file.json' '/Applications/.EcoAssist_files/models/det/MegaDetector 5a/[md_v5a.0.0.pt](http://md_v5a.0.0.pt/)' '/Users/peter/Downloads/single-sp'

--frame_sample=150

Expected: process one frame every 150 frames
Result: processes 3 frames (0, 150, 300) as expected

'/Applications/.EcoAssist_files/miniforge/envs/ecoassistcondaenv-base/bin//python' '/Applications/.EcoAssist_files/cameratraps/megadetector/detection/process_video.py' '--json_confidence_threshold=0.01' '--recursive' '--frame_sample=150' '--frame_folder=/Users/peter/Downloads/temp' '--keep_extracted_frames' '--max_width=1280' '--quality=85' '--output_json_file=/Users/peter/Downloads/single-sp/video_recognition_file.json' '/Applications/.EcoAssist_files/models/det/MegaDetector 5a/[md_v5a.0.0.pt](http://md_v5a.0.0.pt/)' '/Users/peter/Downloads/single-sp'

I started diving into process_video.py and video_utils.py, but figured that it is probably something stupid on my side... So I thought I'd ask you if you see something wrong with my commands?

@agentmorris
Copy link
Owner

Thanks for reporting this, and for providing such a complete description. It turns out it was an esoteric bug that only manifested when --keep_extracted_frames was set. Oops! Fixed now, will follow up by email to see whether you also need me to update the Python package. Let me know when you are able to verify, but I will close the issue, because I'm 98% sure it's fixed.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants