Update gradio_app.py
Browse files- gradio_app.py +5 -5
gradio_app.py
CHANGED
@@ -31,7 +31,7 @@ description = """
|
|
31 |
</p>
|
32 |
<h2 align="center">
|
33 |
<p>ECCV 2024</p>
|
34 |
-
<a href="" align="center">Paper</a> |
|
35 |
<a href="https://github.com/cvg/GeoCalib" align="center">Code</a> |
|
36 |
<a href="https://colab.research.google.com/drive/1oMzgPGppAPAIQxe-s7SRd_q8r7dVfnqo#scrollTo=etdzQZQzoo-K" align="center">Colab</a>
|
37 |
</h2>
|
@@ -80,8 +80,8 @@ def inference(img, camera_model):
|
|
80 |
save_keys = ["camera", "gravity"] + [f"{k}_uncertainty" for k in ["roll", "pitch", "vfov", "focal"]]
|
81 |
res = {k: v.cpu() for k, v in out.items() if k in save_keys}
|
82 |
# not converting to numpy results in gpu abort
|
83 |
-
res["up_confidence"] =
|
84 |
-
res["latitude_confidence"] =
|
85 |
return res
|
86 |
|
87 |
|
@@ -155,10 +155,10 @@ def update_plot(
|
|
155 |
viz2d.plot_latitudes([lat[0, 0]], axes=[ax[0]])
|
156 |
|
157 |
if plot_up_confidence:
|
158 |
-
viz2d.plot_confidences([inference_result["up_confidence"][0]], axes=[ax[0]])
|
159 |
|
160 |
if plot_latitude_confidence:
|
161 |
-
viz2d.plot_confidences([inference_result["latitude_confidence"][0]], axes=[ax[0]])
|
162 |
|
163 |
fig.canvas.draw()
|
164 |
img = np.array(fig.canvas.renderer.buffer_rgba())
|
|
|
31 |
</p>
|
32 |
<h2 align="center">
|
33 |
<p>ECCV 2024</p>
|
34 |
+
<a href="https://arxiv.org/pdf/2409.06704" align="center">Paper</a> |
|
35 |
<a href="https://github.com/cvg/GeoCalib" align="center">Code</a> |
|
36 |
<a href="https://colab.research.google.com/drive/1oMzgPGppAPAIQxe-s7SRd_q8r7dVfnqo#scrollTo=etdzQZQzoo-K" align="center">Colab</a>
|
37 |
</h2>
|
|
|
80 |
save_keys = ["camera", "gravity"] + [f"{k}_uncertainty" for k in ["roll", "pitch", "vfov", "focal"]]
|
81 |
res = {k: v.cpu() for k, v in out.items() if k in save_keys}
|
82 |
# not converting to numpy results in gpu abort
|
83 |
+
res["up_confidence"] = out["up_confidence"].cpu().numpy()
|
84 |
+
res["latitude_confidence"] = out["latitude_confidence"].cpu().numpy()
|
85 |
return res
|
86 |
|
87 |
|
|
|
155 |
viz2d.plot_latitudes([lat[0, 0]], axes=[ax[0]])
|
156 |
|
157 |
if plot_up_confidence:
|
158 |
+
viz2d.plot_confidences([torch.tensor(inference_result["up_confidence"][0])], axes=[ax[0]])
|
159 |
|
160 |
if plot_latitude_confidence:
|
161 |
+
viz2d.plot_confidences([torch.tensor(inference_result["latitude_confidence"][0])], axes=[ax[0]])
|
162 |
|
163 |
fig.canvas.draw()
|
164 |
img = np.array(fig.canvas.renderer.buffer_rgba())
|