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