Enhanced Segmentation Capabilities with Annotation Export capabilities#106
Open
fyzanahammad wants to merge 2 commits into
Open
Enhanced Segmentation Capabilities with Annotation Export capabilities#106fyzanahammad wants to merge 2 commits into
fyzanahammad wants to merge 2 commits into
Conversation
This commit adds functionality to export segmentation masks and bounding boxes in standard annotation formats: Added COCO JSON export with proper polygon segmentation Added YOLO bounding box format export Added YOLO segmentation format export (compatible with YOLOv8-seg) Implemented mask-to-polygon conversion using OpenCV contour detection Added individual mask image export for visualization Modified the Gradio interface to include annotation format selection Improved error handling in the server API Switched to direct model access for more reliable predictions Created automatic directory structure for organized annotation storage
This commit adds several improvements to the batch image segmentation functionality: Organized Output Structure: Created a structured output with three dedicated subfolders: images, bounding_boxes, and masks Implemented consistent file naming across all three folders for better traceability Added single classes.txt file generation for the entire batch instead of per-image Optimized Mask Handling: Disabled individual mask image saving to reduce disk usage and processing time Modified mask handling to properly convert list masks to numpy arrays Added error handling for empty masks UI and Progress Improvements: Added real-time progress tracking with percentage completion Implemented detailed progress messages showing current image and count Fixed model selection dropdown to use correct SAM model names Added completion indicators with checkmarks Bug Fixes: Fixed image counting to avoid double-counting files with different case extensions Improved error handling to continue processing when individual images fail Fixed compatibility issues with older Python versions Ensured consistent annotation file paths across COCO and YOLO formats
Owner
|
Hey @fyzanahammad, appreciate the PR!
What do you think? Let me know if you need help |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhanced Segmentation Capabilities with Annotation Export
Overview
This PR enhances Lang-SAM with comprehensive annotation export capabilities and batch processing improvements, making it more suitable for production computer vision pipelines.
Key Features Added
Annotation Export System
Batch Processing Enhancements
Performance & UX Improvements
Technical Implementation Details
Annotation Processing
Architecture Changes
Windows-Specific Support
win_requirements.txtwith proper CUDA-enabled PyTorch installationTesting
The implementation has been tested with various image inputs and prompts, confirming:
Future Work
Potential future enhancements could include: