Ali Mohsin
commited on
Commit
·
5d5371b
1
Parent(s):
d31b3c9
feat: introduce `rembg` library for background removal functionality
Browse files- app.py +1 -0
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -96,6 +96,7 @@ def extract_frames_and_masks(video_path, garment_name):
|
|
| 96 |
|
| 97 |
# Remove background (get mask)
|
| 98 |
# rembg returns RGBA, alpha channel is the mask
|
|
|
|
| 99 |
output = remove(pil_im)
|
| 100 |
mask = np.array(output)[:, :, 3] # Extract alpha
|
| 101 |
|
|
|
|
| 96 |
|
| 97 |
# Remove background (get mask)
|
| 98 |
# rembg returns RGBA, alpha channel is the mask
|
| 99 |
+
from rembg import remove
|
| 100 |
output = remove(pil_im)
|
| 101 |
mask = np.array(output)[:, :, 3] # Extract alpha
|
| 102 |
|
requirements.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
gradio
|
| 2 |
opencv-python-headless
|
| 3 |
-
onnxruntime
|
| 4 |
wheel
|
| 5 |
ninja
|
| 6 |
setuptools<70
|
|
|
|
| 1 |
gradio
|
| 2 |
opencv-python-headless
|
| 3 |
+
onnxruntime
|
| 4 |
wheel
|
| 5 |
ninja
|
| 6 |
setuptools<70
|