--- license: apache-2.0 tags: - art pretty_name: Open Remove Background Model --- # Open Remove Background Model (ormbg) This model is a **fully open-source background remover** optimized for images with humans. It is based on [Highly Accurate Dichotomous Image Segmentation research](https://github.com/xuebinqin/DIS). This model is similar to [RMBG-1.4](https://huggingface.co/briaai/RMBG-1.4), but with open training data/process and commercially free to use. ## Inference ``` test ``` ## Training The model was trained with the [Human Segmentation Dataset](https://huggingface.co/datasets/schirrmacher/humans). After 10.000 iterations with a single NVIDIA GeForce RTX 4090 the following achievements were made: - Training time: 8 hours - Training loss 0.1179 - Validation loss: 0.1284 - Maximum F1 score: 0.9928 - Mean Absolute Error: 0.005 Output model: `/models/ormbg.pth`. ## Want to train your own model? Checkout _Highly Accurate Dichotomous Image Segmentation_ code: ``` git clone https://github.com/xuebinqin/DIS.git cd DIS ``` Follow the installation instructions on https://github.com/xuebinqin/DIS?tab=readme-ov-file#1-clone-this-repo Download or create some data ([like this](https://huggingface.co/datasets/schirrmacher/humans)) and place it into the DIS project folder. I am applying the folder structure: - training/im (images) - training/gt (ground truth) - validation/im (images) - validation/gt (ground truth) Apply this git patch for setting the right paths and remove normalization of images: ``` git apply dis-repo.patch ``` Start training: ``` cd IS-Net python train_valid_inference_main.py ``` Export to ONNX (modify paths if needed): ``` python utils/pth_to_onnx.py ``` ## Support If you identify edge cases or issues with the model, please contact me!