https://github.com/thomd/image-background-removal-service
Image Backgrond Removal
https://github.com/thomd/image-background-removal-service
computer-vision machine-learning python
Last synced: 2 months ago
JSON representation
Image Backgrond Removal
- Host: GitHub
- URL: https://github.com/thomd/image-background-removal-service
- Owner: thomd
- Created: 2021-11-21T18:35:22.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-31T08:30:29.000Z (over 4 years ago)
- Last Synced: 2025-03-30T19:14:57.360Z (over 1 year ago)
- Topics: computer-vision, machine-learning, python
- Language: Jupyter Notebook
- Homepage:
- Size: 23.4 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Background Removal Service
This service is based on the pre-trained [MODNet](https://github.com/ZHKKKe/MODNet) model.
The folder `model/pretrained` contains the official pre-trained models of MODNet. You can download them from this [link](https://drive.google.com/drive/folders/1umYmlCulvIFNaqPjwod1SayFmSRHziyR?usp=sharing).
## Setup
conda create --name ibrs python=3.9
conda activate ibrs
conda install --yes --file requirements.txt
## Test
python -c "import inference; inference.remove_background('images/lea.jpg')"
## Service Endpoints
Depending on the `Accept` request header, the service returns an PNG image or an DataURI:
curl -F "file=@image.jpg" -H 'Accept: image/png' 'http://localhost:8000/file'
curl -F "file=@image.jpg" -H 'Accept: application/json' 'http://localhost:8000/file'
The service does **not** persist images, but does allow to request the ...
## TODO
- [ ] rate limiter
- [ ] demo webpage
- [ ] error handling