Skip to content

Files

Latest commit

 

History

History

rmbg-background-removal

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Background removal with RMBG v1.4 and OpenVINO

Binder Colab

Background matting is the process of accurately estimating the foreground object in images and videos. It is a very important technique in image and video editing applications, particularly in film production for creating visual effects. In case of image segmentation, we segment the image into foreground and background by labeling the pixels. Image segmentation generates a binary image, in which a pixel either belongs to foreground or background. However, Image Matting is different from the image segmentation, wherein some pixels may belong to foreground as well as background, such pixels are called partial or mixed pixels. In order to fully separate the foreground from the background in an image, accurate estimation of the alpha values for partial or mixed pixels is necessary.

RMBG v1.4 is background removal model, designed to effectively separate foreground from background in a range of categories and image types. This model has been trained on a carefully selected dataset, which includes: general stock images, e-commerce, gaming, and advertising content, making it suitable for commercial use cases powering enterprise content creation at scale. The accuracy, efficiency, and versatility currently rival leading source-available models.

More details about model can be found in model card.

background.gif

In this tutorial we consider how to convert and run this model using OpenVINO.

Notebook Contents

This tutorial demonstrates step-by-step instructions on how to launch RMBG model for background removal using OpenVINO. The tutorial consists of following parts:

  • Download model
  • Run PyTorch model inference
  • Convert PyTorch model to OpenVINO IR format
  • Run OpenVINO model inference
  • Launch interactive demo

Installation Instructions

This is a self-contained example that relies solely on its own code.
We recommend running the notebook in a virtual environment. You only need a Jupyter server to start. For details, please refer to Installation Guide.