Instructions to use linxy97/CustomCodeForRMBG with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use linxy97/CustomCodeForRMBG with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="linxy97/CustomCodeForRMBG", trust_remote_code=True)# Load model directly from transformers import AutoModelForImageSegmentation model = AutoModelForImageSegmentation.from_pretrained("linxy97/CustomCodeForRMBG", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Upload MyPipe.py
Browse files
MyPipe.py
CHANGED
|
@@ -43,7 +43,7 @@ class RMBGPipe(Pipeline):
|
|
| 43 |
def postprocess(self, inputs, out_name=""):
|
| 44 |
result = inputs.pop("result")
|
| 45 |
orig_im_size = inputs.pop("orig_im_size")
|
| 46 |
-
orig_image = inputs.pop("
|
| 47 |
result_image = self.postprocess_image(result[0][0], orig_im_size)
|
| 48 |
if out_name != "":
|
| 49 |
# if out_name is specified we save the image using that name
|
|
|
|
| 43 |
def postprocess(self, inputs, out_name=""):
|
| 44 |
result = inputs.pop("result")
|
| 45 |
orig_im_size = inputs.pop("orig_im_size")
|
| 46 |
+
orig_image = inputs.pop("orig_im")
|
| 47 |
result_image = self.postprocess_image(result[0][0], orig_im_size)
|
| 48 |
if out_name != "":
|
| 49 |
# if out_name is specified we save the image using that name
|