Spaces:
Runtime error
Runtime error
Fix HF runtime deps and Gradio buttons
Browse files
app/ui.py
CHANGED
|
@@ -300,14 +300,12 @@ def build_ui(analyzer: SafetyAnalyzer | None = None) -> gr.Blocks:
|
|
| 300 |
label="Analyzed",
|
| 301 |
height=485,
|
| 302 |
elem_id="main-preview",
|
| 303 |
-
|
| 304 |
-
show_fullscreen_button=False,
|
| 305 |
)
|
| 306 |
orig_view = gr.Image(
|
| 307 |
label="Original",
|
| 308 |
height=485,
|
| 309 |
-
|
| 310 |
-
show_fullscreen_button=False,
|
| 311 |
)
|
| 312 |
gr.HTML(
|
| 313 |
"""
|
|
|
|
| 300 |
label="Analyzed",
|
| 301 |
height=485,
|
| 302 |
elem_id="main-preview",
|
| 303 |
+
buttons=["download"],
|
|
|
|
| 304 |
)
|
| 305 |
orig_view = gr.Image(
|
| 306 |
label="Original",
|
| 307 |
height=485,
|
| 308 |
+
buttons=["download"],
|
|
|
|
| 309 |
)
|
| 310 |
gr.HTML(
|
| 311 |
"""
|
src/depth_anything_3/api.py
CHANGED
|
@@ -31,7 +31,6 @@ from PIL import Image
|
|
| 31 |
from depth_anything_3.cfg import create_object, load_config
|
| 32 |
from depth_anything_3.registry import MODEL_REGISTRY
|
| 33 |
from depth_anything_3.specs import Prediction
|
| 34 |
-
from depth_anything_3.utils.export import export
|
| 35 |
from depth_anything_3.utils.geometry import affine_inverse
|
| 36 |
from depth_anything_3.utils.io.input_processor import InputProcessor
|
| 37 |
from depth_anything_3.utils.io.output_processor import OutputProcessor
|
|
@@ -385,6 +384,8 @@ class DepthAnything3(nn.Module, PyTorchModelHubMixin):
|
|
| 385 |
self, prediction: Prediction, export_format: str, export_dir: str, **kwargs
|
| 386 |
) -> None:
|
| 387 |
"""Export results to specified format and directory."""
|
|
|
|
|
|
|
| 388 |
start_time = time.time()
|
| 389 |
export(prediction, export_format, export_dir, **kwargs)
|
| 390 |
end_time = time.time()
|
|
|
|
| 31 |
from depth_anything_3.cfg import create_object, load_config
|
| 32 |
from depth_anything_3.registry import MODEL_REGISTRY
|
| 33 |
from depth_anything_3.specs import Prediction
|
|
|
|
| 34 |
from depth_anything_3.utils.geometry import affine_inverse
|
| 35 |
from depth_anything_3.utils.io.input_processor import InputProcessor
|
| 36 |
from depth_anything_3.utils.io.output_processor import OutputProcessor
|
|
|
|
| 384 |
self, prediction: Prediction, export_format: str, export_dir: str, **kwargs
|
| 385 |
) -> None:
|
| 386 |
"""Export results to specified format and directory."""
|
| 387 |
+
from depth_anything_3.utils.export import export # Lazy import to avoid optional deps (moviepy) on import time
|
| 388 |
+
|
| 389 |
start_time = time.time()
|
| 390 |
export(prediction, export_format, export_dir, **kwargs)
|
| 391 |
end_time = time.time()
|
src/depth_anything_3/app/modules/ui_components.py
CHANGED
|
@@ -56,7 +56,7 @@ class UIComponents:
|
|
| 56 |
label="Preview",
|
| 57 |
columns=4,
|
| 58 |
height="300px",
|
| 59 |
-
|
| 60 |
object_fit="contain",
|
| 61 |
preview=True,
|
| 62 |
interactive=False,
|
|
|
|
| 56 |
label="Preview",
|
| 57 |
columns=4,
|
| 58 |
height="300px",
|
| 59 |
+
buttons=["download"],
|
| 60 |
object_fit="contain",
|
| 61 |
preview=True,
|
| 62 |
interactive=False,
|