Spaces:
Sleeping
Sleeping
Update gradio_app.py
Browse files- gradio_app.py +4 -5
gradio_app.py
CHANGED
|
@@ -79,14 +79,14 @@ def run_inference(args, cfg, model, batch):
|
|
| 79 |
images = batch["image"].to(device)
|
| 80 |
crop_parameters = batch["crop_parameters"].to(device)
|
| 81 |
|
| 82 |
-
|
| 83 |
model=model,
|
| 84 |
images=images,
|
| 85 |
device=device,
|
| 86 |
crop_parameters=crop_parameters,
|
|
|
|
| 87 |
num_patches_x=cfg.training.full_num_patches_x,
|
| 88 |
num_patches_y=cfg.training.full_num_patches_y,
|
| 89 |
-
additional_timesteps=list(range(11)),
|
| 90 |
calculate_intrinsics=True,
|
| 91 |
max_num_images=8,
|
| 92 |
mode="segment",
|
|
@@ -94,7 +94,6 @@ def run_inference(args, cfg, model, batch):
|
|
| 94 |
use_homogeneous=True,
|
| 95 |
seed=0,
|
| 96 |
)
|
| 97 |
-
pred_cameras, pred_rays = additional_cams[10]
|
| 98 |
|
| 99 |
# Unnormalize and resize input images
|
| 100 |
images = unnormalize_image(images, return_numpy=False, return_int=False)
|
|
@@ -142,7 +141,7 @@ if __name__ == "__main__":
|
|
| 142 |
_DESCRIPTION = """
|
| 143 |
<div>
|
| 144 |
<a style="display:inline-block" href="https://qitaozhao.github.io/DiffusionSfM"><img src='https://img.shields.io/badge/public_website-8A2BE2'></a>
|
| 145 |
-
<a style="display:inline-block; margin-left: .5em" href='https://github.com/QitaoZhao/
|
| 146 |
</div>
|
| 147 |
DiffusionSfM learns to predict scene geometry and camera poses as pixel-wise ray origins and endpoints using a denoising diffusion model.
|
| 148 |
"""
|
|
@@ -205,7 +204,7 @@ if __name__ == "__main__":
|
|
| 205 |
height=520,
|
| 206 |
zoom_speed=0.5,
|
| 207 |
pan_speed=0.5,
|
| 208 |
-
label="3D Point
|
| 209 |
)
|
| 210 |
|
| 211 |
# Link image gallery selection
|
|
|
|
| 79 |
images = batch["image"].to(device)
|
| 80 |
crop_parameters = batch["crop_parameters"].to(device)
|
| 81 |
|
| 82 |
+
(pred_cameras, pred_rays), _ = predict_cameras(
|
| 83 |
model=model,
|
| 84 |
images=images,
|
| 85 |
device=device,
|
| 86 |
crop_parameters=crop_parameters,
|
| 87 |
+
stop_iteration=90,
|
| 88 |
num_patches_x=cfg.training.full_num_patches_x,
|
| 89 |
num_patches_y=cfg.training.full_num_patches_y,
|
|
|
|
| 90 |
calculate_intrinsics=True,
|
| 91 |
max_num_images=8,
|
| 92 |
mode="segment",
|
|
|
|
| 94 |
use_homogeneous=True,
|
| 95 |
seed=0,
|
| 96 |
)
|
|
|
|
| 97 |
|
| 98 |
# Unnormalize and resize input images
|
| 99 |
images = unnormalize_image(images, return_numpy=False, return_int=False)
|
|
|
|
| 141 |
_DESCRIPTION = """
|
| 142 |
<div>
|
| 143 |
<a style="display:inline-block" href="https://qitaozhao.github.io/DiffusionSfM"><img src='https://img.shields.io/badge/public_website-8A2BE2'></a>
|
| 144 |
+
<a style="display:inline-block; margin-left: .5em" href='https://github.com/QitaoZhao/DiffusionSfM'><img src='https://img.shields.io/github/stars/QitaoZhao/DiffusionSfM?style=social'/></a>
|
| 145 |
</div>
|
| 146 |
DiffusionSfM learns to predict scene geometry and camera poses as pixel-wise ray origins and endpoints using a denoising diffusion model.
|
| 147 |
"""
|
|
|
|
| 204 |
height=520,
|
| 205 |
zoom_speed=0.5,
|
| 206 |
pan_speed=0.5,
|
| 207 |
+
label="3D Point Clouds and Recovered Cameras"
|
| 208 |
)
|
| 209 |
|
| 210 |
# Link image gallery selection
|