Closed victor-wildlife closed 5 months ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
@jannesgg I cleaned the commits from the previous two branches and combined them into this one. Please share your thoughts when you have the chance
Summary:
I simplified the way we extract clips as there was a confusion between gpu vs no gpu, example vs non example clips, modified vs non modifed clips and ffmpeg vs python_ffmpeg. The new logic uses the "is_example" argument from the function "create_clips" to generate example or "ready to upload to Zooniverse" clips. We couldn't use ffmpeg with GPU resource in colab anymore so I updated the way we install ffmpeg in colab
In tut#9, I fixed the approach to plot detections and created a way to download the detections as a csv file with the species detections and confidence values for each species as columns
While implementing the above updates I deleted functions we no longer use and organised existing functions (group those that are related).
Breakdown by file:
kso_utils/movie_utils.py I used ffmpeg.run instead of subprocess and the latest GPU to create clips
kso_utils/project.py Used logging statements instead of print Stopped using the "create_modified_clips" as it's no longer needed in the new clip extraction approach Added the "download_detections_species_cols_csv" function moved setup_paths, choose_train_params, train_yolo, train_yolov5, enhance_yolo, enhance_yolov5 and enhance_replace functions to the #t5 section removed "detect_yolov5" fun as no longer used
kso_utils/tutorials_utils.py Deleted the "process_source" "extract_example_clips", "modify_clips", "review_clip_selection" and "create_modified_clips" functions as they're no longer used For easier formatting, I moved the clip-related functions close to each other. Added functionality to check ffmpeg availablity and set the clips to remove audio as default Updated "extract_clips" and "create_clips" to the new clip extraction logic Used pathlib and updated the way the detection matplot handles time (seconds in the movie) to enable plot detections in colab
kso_utils/widgets.py Updated the way we enabled GPU compatibility with ffmpeg in Colab Updated how we display the number of clips to be generated Deleted the "color_correction" option as it doesn't work with our current use of ffmpeg and we don't have any project using it. Updated the blur sens info option to match our current use of ffmpeg
requirements_colab.txt added ffmpeg_python as a requirement
test/widget-tests.py Use crf instead of filter to match the first widget option in select_modification of clips
tutorials/03_Upload_clips_to_Zooniverse.ipynb Matched new naming of modified clips
tutorials/09_Run_ML_Models_on_footage.ipynb added the download_detections_species_cols_csv option