Spaces:
Runtime error
Runtime error
Download bg_removal_engine.py from jmax98/Removeybg-Bot: direct link, hf CLI and curl.
- Browser
- Download file 730 Bytes
-
https://huggingface.co/spaces/jmax98/Removeybg-Bot/resolve/main/bg_removal_engine.py
- Command line
-
hf download hf://spaces/jmax98/Removeybg-Bot/bg_removal_engine.py
-
curl -L -o bg_removal_engine.py https://huggingface.co/spaces/jmax98/Removeybg-Bot/resolve/main/bg_removal_engine.py
730 Bytes
| import gradio as gr | |
| from rembg import remove | |
| from PIL import Image | |
| import numpy as np | |
| def remove_background(input_img): | |
| if input_img is None: | |
| return None | |
| # تحويل الصورة ومعالجتها | |
| output_img = remove(input_img) | |
| return output_img | |
| # إنشاء واجهة ويب بسيطة واحترافية | |
| demo = gr.Interface( | |
| fn=remove_background, | |
| inputs=gr.Image(type="pil", label="ارفع صورتك هنا 🖼️"), | |
| outputs=gr.Image(type="pil", label="النتيجة بدون خلفية ✨"), | |
| title="Removeybg Pro - AI Engine Test", | |
| description="اختبار محرك إزالة الخلفية مباشرة بدون وسيط." | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() |