Spaces:
Running
on
Zero
Running
on
Zero
Update core/process.py
Browse files- core/process.py +10 -1
core/process.py
CHANGED
@@ -2,6 +2,7 @@ import logging
|
|
2 |
import time
|
3 |
import timeout_decorator
|
4 |
import io
|
|
|
5 |
import zipfile
|
6 |
import json
|
7 |
import cv2
|
@@ -151,7 +152,15 @@ def process_image(
|
|
151 |
elapsed = log_runtime(start_time)
|
152 |
logger.info(f"Image processing completed in {elapsed:.2f} seconds.")
|
153 |
|
154 |
-
return final_img, scene_json, ("uvis_results.zip", zip_buf.getvalue())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
except Exception as e:
|
157 |
logger.error(f"Error in processing pipeline: {e}")
|
|
|
2 |
import time
|
3 |
import timeout_decorator
|
4 |
import io
|
5 |
+
import os
|
6 |
import zipfile
|
7 |
import json
|
8 |
import cv2
|
|
|
152 |
elapsed = log_runtime(start_time)
|
153 |
logger.info(f"Image processing completed in {elapsed:.2f} seconds.")
|
154 |
|
155 |
+
#return final_img, scene_json, ("uvis_results.zip", zip_buf.getvalue())
|
156 |
+
# Save ZIP to disk for Gradio file output
|
157 |
+
zip_path = "outputs/uvis_results.zip"
|
158 |
+
os.makedirs("outputs", exist_ok=True)
|
159 |
+
with open(zip_path, "wb") as f:
|
160 |
+
f.write(zip_buf.getvalue())
|
161 |
+
|
162 |
+
return final_img, scene_json, zip_path
|
163 |
+
|
164 |
|
165 |
except Exception as e:
|
166 |
logger.error(f"Error in processing pipeline: {e}")
|