Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,9 +54,11 @@ def remove_background(result):
|
|
| 54 |
elif isinstance(result, str):
|
| 55 |
result = Image.open(result)
|
| 56 |
result = rembg.remove(result)
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
| 60 |
return result
|
| 61 |
|
| 62 |
|
|
|
|
| 54 |
elif isinstance(result, str):
|
| 55 |
result = Image.open(result)
|
| 56 |
result = rembg.remove(result)
|
| 57 |
+
elif isinstance(result, numpy.ndarray):
|
| 58 |
+
print('here ELIF 2')
|
| 59 |
+
# Convert the NumPy array to a PIL Image
|
| 60 |
+
result = Image.fromarray(result)
|
| 61 |
+
result = rembg.remove(result)
|
| 62 |
return result
|
| 63 |
|
| 64 |
|