Skip to content

Add functionality to save segmentation mask during inference for images#50

Open
abdullahmeda wants to merge 8 commits intobaaivision:mainfrom
abdullahmeda:main
Open

Add functionality to save segmentation mask during inference for images#50
abdullahmeda wants to merge 8 commits intobaaivision:mainfrom
abdullahmeda:main

Conversation

@abdullahmeda
Copy link
Copy Markdown

@abdullahmeda abdullahmeda commented Jul 16, 2023

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:

  • Modified inference_image function signature to take the path of the output directory as a parameter rather than the output file path.
  • Added code in inference_image function to save the binary mask to the specified output directory along with the segmented output image.
  • Modified code in seggpt_inference.py script to reflect the aforementioned changes

With 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant