Skip to content

add Segment anything#40

Merged
patrickvonplaten merged 2 commits intohuggingface:masterfrom
jinwonkim93:segment_anything
May 19, 2023
Merged

add Segment anything#40
patrickvonplaten merged 2 commits intohuggingface:masterfrom
jinwonkim93:segment_anything

Conversation

@jinwonkim93
Copy link
Contributor

This PR is to add segment anything.
SamDetector returns segmented map like controlnet-segment-anything.

Usage

from controlnet_aux import SamDetector
from PIL import Image

sam = SamDetector.from_pretrained("./", model_type="vit_b", filename="sam_vit_b_01ec64.pth")
img = Image.open("image.png")
sam(img)

model_type : vit_h, vit_l, vit_b

Limitation

@jinwonkim93 jinwonkim93 changed the title Segment anything add Segment anything May 19, 2023
@patrickvonplaten
Copy link
Contributor

Works for me!

@patrickvonplaten patrickvonplaten merged commit dd7e23f into huggingface:master May 19, 2023
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.

2 participants