Mindket

BiRefNet by ZhengPeng7

Newversion 1 · updated

Overview

Splits an image into the main object and its background at high resolution, from a 2024 research project on dichotomous image segmentation. For developers, image editors and computer vision researchers.

BiRefNet by ZhengPeng7 is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.

At a glance

You need
  • Python on Windows, macOS or Linux
  • The packages from the requirements file in the project's GitHub repository
  • The transformers library, for the simplest loading route
Runs in
  • Python on Windows, macOS and Linux, through the transformers library
  • The project's GitHub code, which you can use with weights from Hugging Face
  • Notebooks, since the card links single-image inference and evaluation notebooks
Start with
pip install -U huggingface_hub
hf download ZhengPeng7/BiRefNet

Platform

WindowsOperating system
macOSOperating system
LinuxOperating system

About

What it is

BiRefNet is an image segmentation model that separates a main object from the rest of a picture, working at high resolution. This repository is the official implementation of a 2024 paper that uses a bilateral reference for dichotomous segmentation. It has 221M parameters.

Who it suits

Developers and researchers who need clean object masks from images. The page also points to a GitHub repository with the code, documentation and a model zoo.

IndustryWho uses itHow they use itExample
Computer visionResearchersStudy high-resolution dichotomous segmentationRun the model on the project's sample images and compare masks
Image editingEditors and tool buildersCut a subject out of its backgroundBuild a feature that isolates the main object in a photo
SoftwareApp developersAdd object masks to an appLoad the model through transformers and call it on uploaded images
Machine learningPractitionersEvaluate or fine-tune a segmentation modelUse the evaluation notebook the card links

You can skip it if you need to label many object classes in a scene. This model makes a two-way split of object and background.

Where to use it

  • Python on Windows, macOS and Linux, through the transformers library
  • The project's GitHub code, which you can use with weights from Hugging Face
  • Notebooks, since the card links single-image inference and evaluation notebooks
Use caseWhoWhat they get back
Object cutoutEditorsA mask separating the main object from the background
Research comparisonResearchersA reference model for dichotomous segmentation
App featureDevelopersMasks produced from images in your own code

How to set it up

You need Python and the packages the project lists.

  • Python on Windows, macOS or Linux
  • The packages from the requirements file in the project's GitHub repository
  • The transformers library, for the simplest loading route
  1. Install Python if you do not have it.
  2. Install the packages listed in the project's requirements file.
  3. Load the model with one of the two routes below.
pip install -U huggingface_hub
hf download ZhengPeng7/BiRefNet

How to use it

The simplest route uses the code and weights hosted on Hugging Face, loaded through transformers. The card notes the hosted code may lag the latest version.

# Load BiRefNet with weights
from transformers import AutoModelForImageSegmentation
birefnet = AutoModelForImageSegmentation.from_pretrained('ZhengPeng7/BiRefNet', trust_remote_code=True)

The other route takes the newest code from GitHub and the weights from Hugging Face. You clone the repository first, then load as below.

# Use codes locally
from models.birefnet import BiRefNet

# Load weights from Hugging Face Models
birefnet = BiRefNet.from_pretrained('ZhengPeng7/BiRefNet')

Example

You load the model with the first snippet and pass it a photo of a product on a cluttered table. It gives back a mask that marks the product as the object and the rest as background.

For newcomers and experts

Segmentation means deciding, pixel by pixel, what belongs to the main object. A first small step is to load the model with the transformers snippet and try it on one clear photo.

The model comes from work on high-resolution dichotomous image segmentation with a bilateral reference. The weights are about 441 MB in F16 and 221M parameters, small enough for a single GPU or a patient CPU. The card offers two loading paths, trading convenience of hosted code against always having the newest code from GitHub.

  1. Install the requirements
  2. Load the model from Hugging Face
  3. Pass in an image
  4. Get an object and background mask

Good to know

  • Loading through transformers uses trust_remote_code, which runs code hosted with the model.
  • The card lists a third route that uses code from GitHub with weights stored locally.
  • The page says the Hugging Face code might trail the newest version.
  • License: MIT.
  • Cost to run: none named.
  • Data it reaches: the images you give it, plus files downloaded from Hugging Face and GitHub.
  • Not for: the card names no limits.

README and files

README

BiRefNet by ZhengPeng7

Splits an image into the main object and its background at high resolution, from a 2024 research project on dichotomous image segmentation. For developers, image editors and computer vision researchers.

Made by ZhengPeng7 on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.

About

What it is: BiRefNet is an image segmentation model that separates a main object from the rest of a picture, working at high resolution. This repository is the official implementation of a 2024 paper that uses a bilateral reference for dichotomous segmentation. It has 221M parameters.

Who it suits: Developers and researchers who need clean object masks from images. The page also points to a GitHub repository with the code, documentation and a model zoo.

Industry | Who uses it | How they use it | Example
Computer vision | Researchers | Study high-resolution dichotomous segmentation | Run the model on the project's sample images and compare masks
Image editing | Editors and tool builders | Cut a subject out of its background | Build a feature that isolates the main object in a photo
Software | App developers | Add object masks to an app | Load the model through transformers and call it on uploaded images
Machine learning | Practitioners | Evaluate or fine-tune a segmentation model | Use the evaluation notebook the card links

You can skip it if you need to label many object classes in a scene. This model makes a two-way split of object and background.

Where to use it:

  • Python on Windows, macOS and Linux, through the transformers library
  • The project's GitHub code, which you can use with weights from Hugging Face
  • Notebooks, since the card links single-image inference and evaluation notebooks
Use case | Who | What they get back
Object cutout | Editors | A mask separating the main object from the background
Research comparison | Researchers | A reference model for dichotomous segmentation
App feature | Developers | Masks produced from images in your own code

How to set it up: You need Python and the packages the project lists.

  • Python on Windows, macOS or Linux
  • The packages from the requirements file in the project's GitHub repository
  • The transformers library, for the simplest loading route
  1. Install Python if you do not have it.
  2. Install the packages listed in the project's requirements file.
  3. Load the model with one of the two routes below.
pip install -U huggingface_hub
hf download ZhengPeng7/BiRefNet

How to use it: The simplest route uses the code and weights hosted on Hugging Face, loaded through transformers. The card notes the hosted code may lag the latest version.

# Load BiRefNet with weights
from transformers import AutoModelForImageSegmentation
birefnet = AutoModelForImageSegmentation.from_pretrained('ZhengPeng7/BiRefNet', trust_remote_code=True)

The other route takes the newest code from GitHub and the weights from Hugging Face. You clone the repository first, then load as below.

# Use codes locally
from models.birefnet import BiRefNet

# Load weights from Hugging Face Models
birefnet = BiRefNet.from_pretrained('ZhengPeng7/BiRefNet')

Example: You load the model with the first snippet and pass it a photo of a product on a cluttered table. It gives back a mask that marks the product as the object and the rest as background.

For newcomers and experts: Segmentation means deciding, pixel by pixel, what belongs to the main object. A first small step is to load the model with the transformers snippet and try it on one clear photo.

The model comes from work on high-resolution dichotomous image segmentation with a bilateral reference. The weights are about 441 MB in F16 and 221M parameters, small enough for a single GPU or a patient CPU. The card offers two loading paths, trading convenience of hosted code against always having the newest code from GitHub.

Install the requirements
Load the model from Hugging Face
Pass in an image
Get an object and background mask

Good to know:

  • Loading through transformers uses trust_remote_code, which runs code hosted with the model.
  • The card lists a third route that uses code from GitHub with weights stored locally.
  • The page says the Hugging Face code might trail the newest version.
  • License: MIT.
  • Cost to run: none named.
  • Data it reaches: the images you give it, plus files downloaded from Hugging Face and GitHub.
  • Not for: the card names no limits.

On Hugging Face, 13 November 2026

  • Task: image segmentation
  • Library: birefnet
  • Parameters: 221M
  • Weights: about 441 MB in F16; about 110 MB at 4-bit (estimate)
  • Formats: Safetensors
  • Downloads in the last 30 days: 1,005,130
  • Likes: 675
  • License: mit
  • Quantized versions: 10
  • Fine-tunes: 7
  • Tags: birefnet, safetensors, image-segmentation, background-removal, mask-generation, pytorch_model_hub_mixin, model_hub_mixin, transformers

Links

Get the model

Download its files with Hugging Face's command line:

pip install -U huggingface_hub
hf download ZhengPeng7/BiRefNet

Then follow the usage in its model card. Nothing in this kit runs by itself.

Files
README.md  5 KB

1 file, 5 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-13

Compare with similar

Listed Hugging Face models in the same category that share the most tags with this one.

ProductDownloads, last 30 daysLikesParametersLicenseLast change
BiRefNet by ZhengPeng7 This page1,005,130675221Mmit
VGGT-1BShares model_hub_mixin · pytorch_model_hub_mixin · safetensors646,1771581.3Bcc-by-nc-4.0
DiT-Wikiart-SmallShares model_hub_mixin · pytorch_model_hub_mixin · safetensors75222Mmit
Koharu Layout HighResShares image-segmentation · safetensors125546.6Mapache-2.0
all-MiniLM-L6-v2Shares transformers · safetensors174,740,1846,10422.7Mapache-2.0
bge-small-en-v1.5Shares transformers · safetensors45,750,54867133.4Mmit
Numbers as Mindket last read them, from 2026-11-12 to 2026-11-13.

Reviews

No ratings yet

Write a review

No reviews yet.

What people say

Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.

Searched

More from Mindket

See all from Mindket

Huashu Design

alchaincyf · Skill

Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…

New29.4k

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Claude Code Skills & Plugins

alirezarezvani · Skill

Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…

New29.8k

Similar in Developer

See all in Developer

buzz

block · Kit

Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…

New37.3k

plannotator

backnotprop · Kit

Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.

New10.5k

open-code-review

alibaba · Kit

Reviews Git changes with an AI agent that reads files and searches the codebase, then writes comments tied to exact lines. It suits developers who want automat…

New50.7k