Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes video rendering performance and enhances object tracking capabilities in SAM3 video segmentation. The main improvements include replacing matplotlib-based rendering with faster OpenCV/numpy operations for the save_video method, adding support for custom object labels, and enabling batch removal of multiple tracked objects. The changes improve both performance (significantly faster video generation) and usability (custom labels and multi-object removal).
- Optimized
_save_blended_framesby replacing matplotlib rendering with OpenCV/numpy array operations for ~10x speed improvement - Extended
remove_objectto accept lists of object IDs for batch removal - Added support for custom object labels via dictionary mapping in visualization methods
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| samgeo/samgeo3.py | Optimized video frame rendering with OpenCV, added list support to remove_object(), and extended show_ids parameter to support custom label dictionaries across visualization methods |
| mkdocs.yml | Added reference to new object tracking example notebook |
| docs/examples/sam3_video_segmentation.ipynb | Removed redundant show_video() call after saving |
| docs/examples/sam3_object_tracking.ipynb | New comprehensive example demonstrating video segmentation, object tracking, custom labels, and batch object removal |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🚀 Deployed on https://693257692a164b3243e2c4c7--opengeos.netlify.app |
Customize object names.
players_segmented.mp4