Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -118,6 +118,8 @@ def run(bucket_folder, person_name, req_id):
|
|
| 118 |
if isinstance(img, torch.Tensor):
|
| 119 |
img = img.detach().cpu()
|
| 120 |
img = transforms.ToPILImage()(img)
|
|
|
|
|
|
|
| 121 |
elif not isinstance(img, Image.Image):
|
| 122 |
continue # skip unknown formats
|
| 123 |
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".png")
|
|
|
|
| 118 |
if isinstance(img, torch.Tensor):
|
| 119 |
img = img.detach().cpu()
|
| 120 |
img = transforms.ToPILImage()(img)
|
| 121 |
+
elif isinstance(img, np.ndarray):
|
| 122 |
+
img = Image.fromarray(img)
|
| 123 |
elif not isinstance(img, Image.Image):
|
| 124 |
continue # skip unknown formats
|
| 125 |
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".png")
|