Skip to content

Add background removal pipeline - #1216

Merged
xenova merged 3 commits into
mainfrom
background-removal-pipeline
Mar 6, 2025
Merged

Add background removal pipeline#1216
xenova merged 3 commits into
mainfrom
background-removal-pipeline

Conversation

@xenova

@xenova xenova commented Mar 3, 2025

Copy link
Copy Markdown
Collaborator

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@xenova
xenova merged commit d799fb6 into main Mar 6, 2025
@xenova
xenova deleted the background-removal-pipeline branch March 6, 2025 13:17
@JonasDoesThings

Copy link
Copy Markdown

Thanks so much for the work @xenova!

Could you maybe share your testing code that worked for briaai/RMBG-2.0? Trying to get it to work myself, but creating the pipeline fails with a strange numeric error and the PR only contains tests for 2 other models 😅

@xenova xenova mentioned this pull request Apr 30, 2025
@TrumanDu

TrumanDu commented Aug 10, 2025

Copy link
Copy Markdown

@JonasDoesThings u can try edit model config.json:

{
  "_name_or_path": "ZhengPeng7/BiRefNet",
  "architectures": [
    "BiRefNet"
  ],
  "auto_map": {
    "AutoConfig": "BiRefNet_config.BiRefNetConfig",
    "AutoModelForImageSegmentation": "birefnet.BiRefNet"
  },
  "custom_pipelines": {
    "image-segmentation": {
      "pt": [
        "AutoModelForImageSegmentation"
      ],
      "tf": [],
      "type": "image"
    }
  },
  "bb_pretrained": false,
  "model_type": "birefnet"
}

@ZhangPeng4242

Copy link
Copy Markdown

@JonasDoesThings u can try edit model config.json:

{
  "_name_or_path": "ZhengPeng7/BiRefNet",
  "architectures": [
    "BiRefNet"
  ],
  "auto_map": {
    "AutoConfig": "BiRefNet_config.BiRefNetConfig",
    "AutoModelForImageSegmentation": "birefnet.BiRefNet"
  },
  "custom_pipelines": {
    "image-segmentation": {
      "pt": [
        "AutoModelForImageSegmentation"
      ],
      "tf": [],
      "type": "image"
    }
  },
  "bb_pretrained": false,
  "model_type": "birefnet"
}

did you make it work? I tried but still not working.

@TrumanDu

Copy link
Copy Markdown

@JonasDoesThings u can try edit model config.json:

{
  "_name_or_path": "ZhengPeng7/BiRefNet",
  "architectures": [
    "BiRefNet"
  ],
  "auto_map": {
    "AutoConfig": "BiRefNet_config.BiRefNetConfig",
    "AutoModelForImageSegmentation": "birefnet.BiRefNet"
  },
  "custom_pipelines": {
    "image-segmentation": {
      "pt": [
        "AutoModelForImageSegmentation"
      ],
      "tf": [],
      "type": "image"
    }
  },
  "bb_pretrained": false,
  "model_type": "birefnet"
}

did you make it work? I tried but still not working.

yeah, I'm ok.

@sliterok

Copy link
Copy Markdown

For anyone else stumbling here from the #1107
To make it work you have to add
"model_type": "birefnet"
at the end of the node_modules/.pnpm/@huggingface+transformers@3.5.1/node_modules/@huggingface/transformers/.cache/briaai/RMBG-2.0/config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants