Run this model with HF Jobs

Run not-lain/CustomCodeForRMBG on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/not-lain/CustomCodeForRMBG. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/not-lain/CustomCodeForRMBG on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
CustomCodeForRMBG / README.md
not-lain's picture
Update README.md
0b8a0c4 verified
|
Raw History Blame Contribute Delete
1.27 kB
---
library_name: transformers
pipeline_tag: image-segmentation
---
# How to use
either load the model
```python
from transformers import AutoModelForImageSegmentation
model = AutoModelForImageSegmentation.from_pretrained("briaai/RMBG-1.4",revision ="refs/pr/9",trust_remote_code=True)
```
or load the pipeline
```python
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.
All rights belong to [briaai](https://huggingface.co/briaai/)
This 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.