Add functionality to save segmentation mask during inference for images#50
Open
abdullahmeda wants to merge 8 commits intobaaivision:mainfrom
Open
Add functionality to save segmentation mask during inference for images#50abdullahmeda wants to merge 8 commits intobaaivision:mainfrom
abdullahmeda wants to merge 8 commits intobaaivision:mainfrom
Conversation
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.
This pull request introduces a new feature that allows the model to not only generate the segmented images but also save the binary mask produced during the inference process.
Related issues:
Changes made:
inference_imagefunction signature to take the path of the output directory as a parameter rather than the output file path.inference_imagefunction to save the binary mask to the specified output directory along with the segmented output image.seggpt_inference.pyscript to reflect the aforementioned changesWith this change, users can now access the binary masks produced by the model during inference, which can be useful for further analysis or for understanding how the model is segmenting the images.
I have tested these changes with several images and the results were as expected: the model correctly saved both the segmented image and the corresponding mask.
I believe this feature will be a valuable addition to SegGPT, enhancing its capabilities and providing users with more insights into the model's behavior.
Possible future works include adapting the above functionality to video inference too. Looking forward to your feedback.