not-lain/CustomCodeForRMBG
08
1---2library_name: transformers3pipeline_tag: image-segmentation4---5 6# How to use 7either load the model 8```python9from transformers import AutoModelForImageSegmentation10model = AutoModelForImageSegmentation.from_pretrained("briaai/RMBG-1.4",revision ="refs/pr/9",trust_remote_code=True)11```12or load the pipeline13```python14from transformers import pipeline15 16pipe = pipeline("image-segmentation", model="briaai/RMBG-1.4",revision ="refs/pr/9", trust_remote_code=True)17 18numpy_mask = pipe("img_path") # outputs numpy mask19 20pipe("image_path",out_name="myout.png") # applies mask and saves the extracted image as `myout.png`21 22```23 24 25 26 27# parameters : 28for the pipeline you can use the following parameters : 29* `model_input_size` : default to [1024,1024]30* `out_name` : if specified it will use the numpy mask to extract the image and save it using the `out_name`31* `preprocess_image` : original method created by briaai32* `postprocess_image` : original method created by briaai33 34# disclamer 35I do not own, distribute or take credit for this model. 36 37All rights belong to [briaai](https://huggingface.co/briaai/) 38 39This repo is a temporary one to test out the custom architecture for [RMBG-1.4](https://huggingface.co/briaai/RMBG-1.4), please do refer to the original model.40 