Skip to content
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

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

abdullahmeda
Copy link

@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