Upload 3 files
Browse files- app.py +26 -0
- git.sh +3 -0
- requirements.txt +3 -0
app.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
os.system("/usr/local/bin/python -m pip install --upgrade pip")
|
| 3 |
+
import gradio as gr
|
| 4 |
+
from rembg import remove
|
| 5 |
+
import cv2
|
| 6 |
+
|
| 7 |
+
def inference(img):
|
| 8 |
+
input_img = cv2.imread(img)
|
| 9 |
+
output = remove(input_img[:, :, [2,1,0]])
|
| 10 |
+
return output
|
| 11 |
+
|
| 12 |
+
title = "REMOVEDOR DE FUNDO"
|
| 13 |
+
|
| 14 |
+
description = "By: Giovanne😊"
|
| 15 |
+
|
| 16 |
+
article = "<p style='text-align: center'>Instagram: @gz_777x</p>"
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
gr.Interface(
|
| 20 |
+
inference,
|
| 21 |
+
gr.inputs.Image(type="filepath", label="Input"),
|
| 22 |
+
gr.outputs.Image(type="pil", label="Output"),
|
| 23 |
+
title=title,
|
| 24 |
+
description=description,
|
| 25 |
+
article=article
|
| 26 |
+
).launch()
|
git.sh
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
git add .
|
| 2 |
+
git commit -m "1.0"
|
| 3 |
+
git push
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio==2.9.4
|
| 2 |
+
opencv-python==4.6.0.66
|
| 3 |
+
rembg==2.0.25
|