-
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
Fix ffmpeg install on macos #329
Conversation
✅ Deploy Preview for silly-keller-664934 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
9e9216b
to
9040888
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #329 +/- ##
======================================
Coverage 87.4% 87.4%
======================================
Files 26 26
Lines 2191 2191
======================================
Hits 1915 1915
Misses 276 276 |
@@ -438,7 +438,7 @@ def test_megadetector_lite_yolox_dog(tmp_path): | |||
[ | |||
"ffmpeg", | |||
"-r", | |||
"60", | |||
"30", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like something funky was happening in the creation of the video from individual images (which is not our standard workflow, the goal was just to create a video with known frames with objects). We separately test MegadetectorLite just on the stack of 10 frames and get the right detections out.
zamba/tests/test_megadetector_lite_yolox.py
Lines 70 to 90 in 70e79f2
def test_detect_video(mdlite, dog): | |
total_frames = 10 | |
object_frame_indices = [0, 3, 4, 6] | |
video = np.zeros([total_frames] + list(dog.size[::-1]) + [3], dtype=np.uint8) | |
video[object_frame_indices] = np.array(dog) | |
mdlite = MegadetectorLiteYoloX() | |
detections = mdlite.detect_video(video) | |
# Check that we detected the correct number of frames | |
assert sum(len(score) > 0 for _, score in detections) == len(object_frame_indices) | |
for frame_index, (frame, (_, score)) in enumerate(zip(video, detections)): | |
if len(score) > 0: | |
# Frame index is in intended frame indices | |
assert frame_index in object_frame_indices | |
# No blank frames were selected | |
assert not (frame == np.zeros(frame.shape, dtype=np.uint8)).all() |
I can't explain why but any frame rate other than 60 makes this test pass 🤷♀️ I use 30 here since that's typically what we see in videos coming in
@@ -458,7 +458,9 @@ def test_megadetector_lite_yolox_dog(tmp_path): | |||
"-y", | |||
] | |||
) | |||
frames = load_video_frames(tmp_path / "dog.mp4", megadetector_lite_config={"confidence": 0.25}) | |||
frames = load_video_frames( | |||
tmp_path / "dog.mp4", megadetector_lite_config=MegadetectorLiteYoloXConfig() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default is a confidence of 0.25 so this isn't changing the underlying behavior
Closes #315
Closes #326
Closes #327
Closes #328