Mask Generation
Refiners
Safetensors
vision
image-segmentation
matting
remove background
background
background-removal
salient-object-detection
PyTorch
Instructions to use finegrain/finegrain-box-segmenter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Refiners
How to use finegrain/finegrain-box-segmenter with Refiners:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
how to input prompt?
#4
by yy10112001 - opened
in this example, I don't have a clue how to input prompt to specific which item to cut.
Can I have some help?
from PIL import Image
from refiners.solutions import BoxSegmenter
input_image = Image.open("input.png")
Downloads the weights from finegrain/finegrain-box-segmenter
segmenter = BoxSegmenter()
box_prompt is (x_min, y_min, x_max, y_max)
mask = segmenter(input_image, box_prompt=(24, 133, 588, 531))
Or without box_prompt as a background remover
mask = segmenter(input_image.convert("RGB"))
mask.save("output.png")
great. thx for your help!
yy10112001 changed discussion status to closed