from transformers import AutoModelForImageSegmentation
model = AutoModelForImageSegmentation.from_pretrained("briaai/RMBG-1.4",revision ="refs/pr/9",trust_remote_code=True)
or load the pipeline
from transformers import pipeline
pipe = pipeline("image-segmentation", model="briaai/RMBG-1.4",revision ="refs/pr/9", trust_remote_code=True)
numpy_mask = pipe("img_path") # outputs numpy mask
pipe("image_path",out_name="myout.png") # applies mask and saves the extracted image as `myout.png`
parameters :
for the pipeline you can use the following parameters :
model_input_size
: default to [1024,1024]
out_name
: if specified it will use the numpy mask to extract the image and save it using the
out_name
preprocess_image
: original method created by briaai
postprocess_image
: original method created by briaai
disclamer
I do not own, distribute or take credit for this model.
This repo is a temporary one to test out the custom architecture for
RMBG-1.4
, please do refer to the original model.
Runs of not-lain CustomCodeForRMBG on huggingface.co
8
Total runs
1
24-hour runs
0
3-day runs
-2
7-day runs
1
30-day runs
More Information About CustomCodeForRMBG huggingface.co Model
CustomCodeForRMBG huggingface.co
CustomCodeForRMBG huggingface.co is an AI model on huggingface.co that provides CustomCodeForRMBG's model effect (), which can be used instantly with this not-lain CustomCodeForRMBG model. huggingface.co supports a free trial of the CustomCodeForRMBG model, and also provides paid use of the CustomCodeForRMBG. Support call CustomCodeForRMBG model through api, including Node.js, Python, http.
CustomCodeForRMBG huggingface.co is an online trial and call api platform, which integrates CustomCodeForRMBG's modeling effects, including api services, and provides a free online trial of CustomCodeForRMBG, you can try CustomCodeForRMBG online for free by clicking the link below.
not-lain CustomCodeForRMBG online free url in huggingface.co:
CustomCodeForRMBG is an open source model from GitHub that offers a free installation service, and any user can find CustomCodeForRMBG on GitHub to install. At the same time, huggingface.co provides the effect of CustomCodeForRMBG install, users can directly use CustomCodeForRMBG installed effect in huggingface.co for debugging and trial. It also supports api for free installation.