Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

[+] add save and load embedding methods in SamPredictor class #724

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kirscher
Copy link

@Kirscher Kirscher commented Apr 4, 2024

Added save and load functionality for image embeddings in SamPredictor class.

This pull request includes two new methods in the SamPredictor class:

  • save_image_embedding(self, path): This method allows saving the image embedding to a specified path. It raises a RuntimeError if an image has not been set with .set_image() before saving the embedding.
  • load_image_embedding(self, path): This method allows loading the image embedding from a specified path and sets it as an attribute of the object. It uses the torch library to load the saved embedding.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants