Spaces:
Build error
Build error
Download app.py from Subham9126/BRIA-RMBG-2.0: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/spaces/Subham9126/BRIA-RMBG-2.0/resolve/main/app.py
- Command line
-
hf download hf://spaces/Subham9126/BRIA-RMBG-2.0/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Subham9126/BRIA-RMBG-2.0/resolve/main/app.py
542 Bytes
| import gradio as gr | |
| from rembg import remove | |
| from PIL import Image | |
| import io | |
| def fast_process(input_image): | |
| if input_image is None: | |
| return None | |
| # Rembg handles the ONNX optimization internally | |
| output = remove(input_image) | |
| return output | |
| demo = gr.Interface( | |
| fn=fast_process, | |
| inputs=gr.Image(type="pil"), | |
| outputs=gr.Image(type="pil"), | |
| title="Ultra-Fast CPU Background Remover", | |
| description="Using rembg + ONNX for 1-2 second processing on most CPUs." | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() |