Spaces:
Paused
Paused
Commit
·
3895075
1
Parent(s):
afd17e4
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,8 +82,9 @@ lama_cleaner_model= None
|
|
| 82 |
ram_model = None
|
| 83 |
|
| 84 |
def load_image(image_path):
|
| 85 |
-
|
| 86 |
-
|
|
|
|
| 87 |
image_pil = image_path
|
| 88 |
else:
|
| 89 |
image_pil = Image.open(image_path).convert("RGB") # load image
|
|
|
|
| 82 |
ram_model = None
|
| 83 |
|
| 84 |
def load_image(image_path):
|
| 85 |
+
if isinstance(image_path, np.ndarray):
|
| 86 |
+
image_pil = Image.fromarray(image_path.astype(np.uint8))
|
| 87 |
+
elif isinstance(image_path, PIL.Image.Image):
|
| 88 |
image_pil = image_path
|
| 89 |
else:
|
| 90 |
image_pil = Image.open(image_path).convert("RGB") # load image
|