Spaces:
Running
on
Zero
Running
on
Zero
ZhengPeng7
commited on
Commit
•
6f7ea50
1
Parent(s):
741bf59
Update app.py
Browse files
app.py
CHANGED
@@ -144,11 +144,12 @@ def predict(images, resolution, weights_file):
|
|
144 |
|
145 |
torch.cuda.empty_cache()
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
150 |
|
151 |
-
if len(
|
152 |
zip_file_path = os.path.join(save_dir, "{}.zip".format(save_dir))
|
153 |
with zipfile.ZipFile(zip_file_path, 'w') as zipf:
|
154 |
for file in save_paths:
|
|
|
144 |
|
145 |
torch.cuda.empty_cache()
|
146 |
|
147 |
+
if isinstance(images, list):
|
148 |
+
save_file_path = os.path.join(save_dir, "{}.png".format(os.path.splitext(os.path.basename(image_src))[0]))
|
149 |
+
cv2.imwrite(save_file_path)
|
150 |
+
save_paths.append(save_file_path)
|
151 |
|
152 |
+
if len(save_paths) > 1:
|
153 |
zip_file_path = os.path.join(save_dir, "{}.zip".format(save_dir))
|
154 |
with zipfile.ZipFile(zip_file_path, 'w') as zipf:
|
155 |
for file in save_paths:
|