close figures and set cache deletion
Browse files
app.py
CHANGED
|
@@ -206,6 +206,8 @@ def run_demo(
|
|
| 206 |
)
|
| 207 |
undist_im = undist_im.cpu().permute(1, 2, 0).numpy()
|
| 208 |
|
|
|
|
|
|
|
| 209 |
return (fig_ff, fig_pa, undist_im, summary)
|
| 210 |
|
| 211 |
|
|
@@ -225,6 +227,7 @@ def build_demo() -> gr.Blocks:
|
|
| 225 |
with gr.Blocks(
|
| 226 |
title="AnyCalib demo",
|
| 227 |
fill_height=True,
|
|
|
|
| 228 |
) as demo:
|
| 229 |
gr.HTML(description)
|
| 230 |
with gr.Row():
|
|
|
|
| 206 |
)
|
| 207 |
undist_im = undist_im.cpu().permute(1, 2, 0).numpy()
|
| 208 |
|
| 209 |
+
plt.close(fig_ff)
|
| 210 |
+
plt.close(fig_pa)
|
| 211 |
return (fig_ff, fig_pa, undist_im, summary)
|
| 212 |
|
| 213 |
|
|
|
|
| 227 |
with gr.Blocks(
|
| 228 |
title="AnyCalib demo",
|
| 229 |
fill_height=True,
|
| 230 |
+
delete_cache=(3600, 3600),
|
| 231 |
) as demo:
|
| 232 |
gr.HTML(description)
|
| 233 |
with gr.Row():
|