A high-performance, 100% offline desktop application for professional AI background removal from images. Built with Go (Golang), Wails v2, and Vue 3, it delivers state-of-the-art results using the RMBG-2.0 model powered by ONNX Runtime.
- 100% Offline: No images are uploaded to any server. All processing happens locally.
- High Accuracy: Uses the state-of-the-art RMBG-2.0 model.
- Fast Performance: GPU-accelerated (on supported systems) and optimized with ONNX Runtime.
- Modern UI: Clean, responsive interface with a "before and after" comparison slider.
- Privacy First: Your data never leaves your machine.
| Layer | Technology |
|---|---|
| Desktop Framework | Wails v2 |
| Backend | Go 1.24+ |
| Frontend | Vue 3 + TypeScript |
| Styling | Tailwind CSS v3 |
| ML Inference | ONNX Runtime (via CGO) |
| Model | RMBG-2.0 (BiRefNet) |
Before you begin, ensure you have the following installed:
- Go: Version 1.24 or higher.
- Node.js & npm: For frontend development.
- Wails CLI: Install via
go install github.com/wailsapp/wails/v2/cmd/wails@latest. - ONNX Runtime: The shared library (
libonnxruntime.so) must be installed on your system.
You can use the provided Makefile to set up ONNX Runtime automatically on Ubuntu/Debian-based systems:
make setupAlternatively, manually:
- Download the ONNX Runtime binaries from the official releases.
- Copy
libonnxruntime.so.x.y.zto/usr/lib/x86_64-linux-gnu/(or equivalent for your OS). - Run
sudo ldconfig.
remove-bg-go/
├── app.go # Wails Application Logic
├── internal/
│ └── inference/ # ONNX Inference Module (Go)
├── models/
│ └── RMBG-2.0/ # AI Model (ONNX format)
├── frontend/ # Vue 3 Frontend
└── build/ # Build Artifacts
The application follows a clean separation between the frontend (Vue 3) and the backend (Go), communicating via Wails IPC.
graph TD
A[Vue 3 Frontend] <-->|IPC / Wails Bridge| B[Go Backend]
B --> C[ONNX Runtime Layer]
C --> D[RMBG-2.0 Model]
- Input: Image is converted to Base64 in the frontend and sent to Go.
- Preprocessing:
- Resize to 1024x1024.
- Normalization (mean=0.5, std=0.5).
- NCHW format conversion
[1, 3, 1024, 1024].
- Inference: Computed via ONNX Runtime (CGO).
- Postprocessing:
- Mask resizing to original dimensions.
- Alpha channel application.
- PNG encoding.
- Output: Resulting Base64 image returned to the UI.
Run the following command to start the application with hot-reloading:
# Install dependencies
go mod tidy
cd frontend && npm install
# Run application
wails devTo build a standalone executable:
make build
# Or
wails buildThe binary will be located in build/bin/remove-bg-go.
This application uses the RMBG-2.0 model, which is a state-of-the-art background removal model developed by BRIA AI.
- Input Size: 1024x1024 (Auto-resized)
- Format: ONNX (FP16 optimized)
- Size: ~977MB
Since ONNX Runtime uses CGO, you must ensure CGO_ENABLED=1 during build. If you encounter issues finding the .so file at runtime, you can specify the path:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/onnxruntime/libs
./remove-bg-goThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Made with ❤️ by Oscar Silva
