Alessio Grancini commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,9 @@ import plotly.graph_objects as go
|
|
| 11 |
from io import BytesIO
|
| 12 |
from PIL import Image
|
| 13 |
import base64
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
from image_segmenter import ImageSegmenter
|
| 16 |
from monocular_depth_estimator import MonocularDepthEstimator
|
|
@@ -19,8 +22,6 @@ from point_cloud_generator import display_pcd
|
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
device = torch.device("cpu") # Start in CPU mode
|
| 25 |
|
| 26 |
def initialize_gpu():
|
|
@@ -376,7 +377,8 @@ if __name__ == "__main__":
|
|
| 376 |
inputs=img_input,
|
| 377 |
outputs=[segmentation_img_output, depth_img_output, dist_img_output, pcd_img_output],
|
| 378 |
fn=process_image,
|
| 379 |
-
cache_examples=
|
|
|
|
| 380 |
)
|
| 381 |
|
| 382 |
with gr.Tab("Video"):
|
|
|
|
| 11 |
from io import BytesIO
|
| 12 |
from PIL import Image
|
| 13 |
import base64
|
| 14 |
+
import sys
|
| 15 |
+
import csv
|
| 16 |
+
csv.field_size_limit(1048576) # 1MB
|
| 17 |
|
| 18 |
from image_segmenter import ImageSegmenter
|
| 19 |
from monocular_depth_estimator import MonocularDepthEstimator
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
|
|
|
|
|
|
|
| 25 |
device = torch.device("cpu") # Start in CPU mode
|
| 26 |
|
| 27 |
def initialize_gpu():
|
|
|
|
| 377 |
inputs=img_input,
|
| 378 |
outputs=[segmentation_img_output, depth_img_output, dist_img_output, pcd_img_output],
|
| 379 |
fn=process_image,
|
| 380 |
+
cache_examples=False,
|
| 381 |
+
#cache_examples=True,
|
| 382 |
)
|
| 383 |
|
| 384 |
with gr.Tab("Video"):
|