{"id":13621657,"url":"https://github.com/locaal-ai/obs-backgroundremoval","last_synced_at":"2025-05-13T23:05:09.587Z","repository":{"id":37953925,"uuid":"358081783","full_name":"locaal-ai/obs-backgroundremoval","owner":"locaal-ai","description":"An OBS plugin for removing background in portrait images (video), making it easy to replace the background when recording or streaming.","archived":false,"fork":false,"pushed_at":"2025-04-01T19:55:39.000Z","size":88597,"stargazers_count":3288,"open_issues_count":9,"forks_count":222,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-05-07T18:31:44.721Z","etag":null,"topics":["background-segmentation","computer-vision","image-segmentation","libobs","mac-osx","obs","obs-plugin","obs-studio","obs-studio-plugin","obsproject","onnx","onnx-runtime","onnxruntime","onnxruntime-gpu","plugin","video-segmentation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/locaal-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["royshil","umireon"]}},"created_at":"2021-04-15T00:44:35.000Z","updated_at":"2025-05-07T00:56:40.000Z","dependencies_parsed_at":"2023-10-04T17:53:29.939Z","dependency_job_id":"5cc77847-6ead-412a-84e0-cd6a68b240b7","html_url":"https://github.com/locaal-ai/obs-backgroundremoval","commit_stats":{"total_commits":310,"total_committers":25,"mean_commits":12.4,"dds":0.5483870967741935,"last_synced_commit":"00576b987bf351de9013e0e89f646c5f7682e69c"},"previous_names":["obs-ai/obs-backgroundremoval","occ-ai/obs-backgroundremoval","royshil/obs-backgroundremoval","locaal-ai/obs-backgroundremoval"],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locaal-ai%2Fobs-backgroundremoval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locaal-ai%2Fobs-backgroundremoval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locaal-ai%2Fobs-backgroundremoval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locaal-ai%2Fobs-backgroundremoval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/locaal-ai","download_url":"https://codeload.github.com/locaal-ai/obs-backgroundremoval/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253673903,"owners_count":21945680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["background-segmentation","computer-vision","image-segmentation","libobs","mac-osx","obs","obs-plugin","obs-studio","obs-studio-plugin","obsproject","onnx","onnx-runtime","onnxruntime","onnxruntime-gpu","plugin","video-segmentation"],"created_at":"2024-08-01T21:01:09.215Z","updated_at":"2025-05-13T23:05:09.542Z","avatar_url":"https://github.com/locaal-ai.png","language":"C++","funding_links":["https://github.com/sponsors/royshil","https://github.com/sponsors/umireon","https://github.com/sponsors/royshil?frequency=one-time"],"categories":["\u003ca name=\"cpp\"\u003e\u003c/a\u003eC++","HarmonyOS","C++"],"sub_categories":["Windows Manager"],"readme":"# OBS Plugin: Portrait Background Removal / Virtual Green-screen and Low-Light Enhancement\n\n\u003cdiv align=\"center\"\u003e\n\n[![GitHub](https://img.shields.io/github/license/locaal-ai/obs-backgroundremoval)](https://github.com/locaal-ai/obs-backgroundremoval/blob/main/LICENSE)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/locaal-ai/obs-backgroundremoval/push.yaml)](https://github.com/locaal-ai/obs-backgroundremoval/actions/workflows/push.yaml)\n[![Total downloads](https://img.shields.io/github/downloads/locaal-ai/obs-backgroundremoval/total)](https://github.com/locaal-ai/obs-backgroundremoval/releases)\n![Flathub](https://img.shields.io/flathub/downloads/com.obsproject.Studio.Plugin.BackgroundRemoval?label=Flathub%20Installs)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/locaal-ai/obs-backgroundremoval)](https://github.com/locaal-ai/obs-backgroundremoval/releases)\n[![Discord](https://img.shields.io/discord/1200229425141252116)](https://discord.gg/KbjGU2vvUz)\n\n\u003c/div\u003e\n\nA plugin for [OBS Studio](https://obsproject.com/) that allows you to replace the background in portrait images and video, as well as enhance low-light scenes.\n\n- [Usage](#usage)\n- [Download](#download)\n- [Introduction](#introduction)\n- [Building](#building)\n  - [MacOSX](#mac-osx)\n  - [Linux (Ubuntu, Arch, openSUSE, Fedora)](#linux)\n  - [Windows](#windows)\n\nFor other AI plugins from us check out [locaal AI](https://github.com/locaal-ai).\n\n## Usage\n\n\u003cdiv align=\"center\"\u003e\n\u003cvideo src=\"https://github.com/locaal-ai/obs-backgroundremoval/assets/1067855/5ba5aae2-7ea2-4c90-ad45-fba5ccde1a4e\" width=\"320\"\u003e\u003c/video\u003e\n\u003c/div\u003e\n\nCheck out the [usage guide page](https://locaal-ai.github.io/obs-backgroundremoval/usage) for usage walkthrough and recommendations.\n\nAdditional tutorial videos:\n\n- Usage tutorial: https://youtu.be/veqNEsMqEE0\n- Depth of Field effect: https://youtu.be/jC3EKSpNjQk\n- Low-light enhancement: https://youtu.be/WSBLYWFrn2Q\n- Remove background from ANY object (not just human): https://youtu.be/N74VCDCToX8\n\n## Download\n\nCheck out the [guide page](https://locaal-ai.github.io/obs-backgroundremoval) for downloads and install instructions for **Windows** and **MacOS**.\n\n### Linux Installation\n\nOn Ubuntu, there are two ways to install OBS and you have to use the corresponding method to install this plugin.\n\n- If you installed OBS via the official PPA, download the deb package from the [releases](https://github.com/locaal-ai/obs-backgroundremoval/releases) page and install it directly.\n- If you installed OBS via FlatHub, run the following command: `flatpak install com.obsproject.Studio.Plugin.BackgroundRemoval`\n\nThe pre-built binary of this plugin can run Ubuntu 22.04 or later.\n\nOn openSUSE, please see [`docs/BUILDING-OPENSUSE.md`](docs/BUILDING-OPENSUSE.md).\n\n#### FlatHub\n\nOn Debian, you cannot use our deb package and we only support FlatHub installation.\n\nOn other Linux distros, use the FlatHub installation of both OBS and this plugin.\n\n```\nflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo\nflatpak install flathub com.obsproject.Studio\nflatpak install flathub com.obsproject.Studio.Plugin.BackgroundRemoval\n```\n\nIf you install OBS in a way other than FlatHub, you have to build this plugin by yourself (see instructions for building [below](#linux)).\n\n### OBS Version Support and Compatibility\n\n- OBS version 29+ ([download](https://obsproject.com/download)) for the latest version of this plugin, e.g. 1.1.x and above.\n- OBS version 28+ for this plugin's version between 0.5.x and 1.0.x.\n- OBS version 27+ for this plugin's version 0.4.x and below.\n\n## Introduction\n\nThis plugin is meant to make it easy to replace the background in portrait images and video.\nIt is using a neural network to predict the mask of the portrait and remove the background pixels.\nIt's easily composable with other OBS plugins to replace the background with e.g. an image or\na transparent color.\n\nIf you like this work, which is given to you completely free of charge, please consider supporting it by sponsoring us on GitHub:\n\n- https://github.com/sponsors/royshil\n- https://github.com/sponsors/umireon\n\n### Support and Help\n\nReach out to us on [Discord](https://discord.gg/3EUBUjpCD3) or the [OBS Plugins forum](https://obsproject.com/forum/resources/background-removal-portrait-segmentation.1260/) for online / immediate help.\n\nIf you found a bug or want to suggest a feature or improvement please open an [issue](https://github.com/locaal-ai/obs-backgroundremoval/issues).\n\nIf you are looking for hands-on help or private consultation please select a [sponsorship tier](https://github.com/sponsors/royshil?frequency=one-time).\n\n### Technical Details\n\nGPU support:\n\n- Currently on Windows we support DirectML, which should reduce CPU usage by 95% and effectively use the systems accelerators (GPUs if available).\n- On Mac we support CoreML for acceleration, which is available on M1 and M2 (not Intel, sorry).\n- CUDA is supported in this plugin through TensorRT, however it is supported only on Linux.\n- The goal of this plugin is to be available for everyone on every system, even if they don't own a GPU.\n\nNumber of CPU threads is controllable through the UI settings. A 2-thread setting works best.\n\nThe pretrained model weights used for portrait foreground segmentation are taken from:\n\n- https://github.com/anilsathyan7/Portrait-Segmentation/tree/master/SINet\n- https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.7/contrib/PP-HumanSeg\n- https://github.com/PINTO0309/PINTO_model_zoo/tree/main/082_MediaPipe_Meet_Segmentation\n- https://github.com/PeterL1n/RobustVideoMatting\n- https://github.com/PINTO0309/PINTO_model_zoo/tree/main/384_TCMonoDepth and https://github.com/yu-li/TCMonoDepth\n- https://huggingface.co/briaai/RMBG-1.4\n\nImage enhancement (low light) models are taken from:\n\n- https://github.com/PINTO0309/PINTO_model_zoo/tree/main/213_TBEFN\n- https://github.com/PINTO0309/PINTO_model_zoo/tree/main/372_URetinex-Net\n- https://github.com/PINTO0309/PINTO_model_zoo/tree/main/370_Semantic-Guided-Low-Light-Image-Enhancement\n- https://github.com/PINTO0309/PINTO_model_zoo/tree/main/243_Zero-DCE-improved\n\nSome more information about how I built it: https://www.morethantechnical.com/2021/04/15/obs-plugin-for-portrait-background-removal-with-onnx-sinet-model/ and https://www.morethantechnical.com/2023/05/20/building-an-obs-background-removal-plugin-a-walkthrough/\n\n### Code Walkthrough\n\nThis video on YouTube will take you through the major parts of the code and explain them.\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://youtu.be/iFQtcJg0Wsk\" target=\"_blank\"\u003e\n    \u003cimg width=\"50%\" src=\"https://img.youtube.com/vi/iFQtcJg0Wsk/maxresdefault.jpg\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## Building\n\nThe plugin was built and tested on Mac OSX (Intel \u0026 Apple silicon), Windows and several Linux disros (e.g. Ubuntu/Debian-ish, Fedora, and more). Help is appreciated in building on other OSs and packages.\n\nThe building pipelines in CI take care of the heavy lifting. Use them in order to build the plugin locally. We attempt to use external OpenCV, libcurl and ONNX Runtime to reduce build times.\n\nStart by cloning this repo to a directory of your choice.\n\n### Mac OSX\n\nUsing the CI pipeline scripts, locally you would just call the zsh script. By default this builds a universal binary for both Intel and Apple Silicon. To build for a specific architecture please see `.github/scripts/.build.zsh` for the `-arch` options.\n\n```sh\n$ ./.github/scripts/build-macos -c Release\n```\n\n#### Install\n\nThe above script should succeed and the plugin files (e.g. `obs-backgroundremoval.plugin`) will reside in the `./release/Release` folder off of the root. Copy the `.plugin` file to the OBS directory e.g. `~/Library/Application Support/obs-studio/plugins`.\n\nTo get `.pkg` installer file, run for example\n\n```sh\n$ ./.github/scripts/package-macos -c Release\n```\n\n(Note that maybe the outputs will be in the `Release` folder and not the `install` folder like `pakage-macos` expects, so you will need to rename the folder from `build_x86_64/Release` to `build_x86_64/install`)\n\n### Linux\n\n#### Ubuntu\n\nUse the CI scripts again\n\n```sh\n$ ./.github/scripts/build-linux.sh\n```\n\n#### Arch Linux\n\nThe community maintains AUR packages: https://aur.archlinux.org/packages/obs-backgroundremoval\n\n#### Fedora\n\nTo compile on Fedora, you need to manage the dependencies manually. See [docs/BUILDING-FEDORA.md](docs/BUILDING-FEDORA.md) for more information.\n\n#### FlatHub\n\nThe plugin is available on FlatHub: https://github.com/flathub/com.obsproject.Studio.Plugin.BackgroundRemoval\n\n```sh\n$ flatpak install com.obsproject.Studio.Plugin.BackgroundRemoval\n```\n\n### Windows\n\nUse the CI scripts again, for example:\n\n```powershell\n\u003e .github/scripts/Build-Windows.ps1 -Target x64 -CMakeGenerator \"Visual Studio 17 2022\"\n```\n\nThe build should exist in the `./release` folder off the root. You can manually install the files in the OBS directory.\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=locaal-ai/obs-backgroundremoval\u0026type=Date\u0026theme=dark\" /\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=locaal-ai/obs-backgroundremoval\u0026type=Date\" /\u003e\n  \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=locaal-ai/obs-backgroundremoval\u0026type=Date\" /\u003e\n\u003c/picture\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocaal-ai%2Fobs-backgroundremoval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocaal-ai%2Fobs-backgroundremoval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocaal-ai%2Fobs-backgroundremoval/lists"}