Spaces:
Running
on
Zero
Running
on
Zero
| # Copyright 2023-2025 Marigold Team, ETH Zürich. All rights reserved. | |
| # This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. | |
| # See https://creativecommons.org/licenses/by-sa/4.0/ for details. | |
| # -------------------------------------------------------------------------- | |
| # DualVision is a Gradio template app for image processing. It was developed | |
| # to support the Marigold project. If you find this code useful, we kindly | |
| # ask you to cite our most relevant papers. | |
| # More information about Marigold: | |
| # https://marigoldmonodepth.github.io | |
| # https://marigoldcomputervision.github.io | |
| # Efficient inference pipelines are now part of diffusers: | |
| # https://huggingface.co/docs/diffusers/using-diffusers/marigold_usage | |
| # https://huggingface.co/docs/diffusers/api/pipelines/marigold | |
| # Examples of trained models and live demos: | |
| # https://huggingface.co/prs-eth | |
| # Related projects: | |
| # https://marigolddepthcompletion.github.io/ | |
| # https://rollingdepth.github.io/ | |
| # Citation (BibTeX): | |
| # https://github.com/prs-eth/Marigold#-citation | |
| # https://github.com/prs-eth/Marigold-DC#-citation | |
| # https://github.com/prs-eth/rollingdepth#-citation | |
| # -------------------------------------------------------------------------- | |
| from pathlib import Path | |
| import gradio | |
| from gradio.utils import get_cache_folder | |
| class Examples(gradio.helpers.Examples): | |
| def __init__(self, *args, directory_name=None, **kwargs): | |
| super().__init__(*args, **kwargs, _initiated_directly=False) | |
| if directory_name is not None: | |
| self.cached_folder = get_cache_folder() / directory_name | |
| self.cached_file = Path(self.cached_folder) / "log.csv" | |
| self.cached_indices_file = Path(self.cached_folder) / "indices.csv" | |
| self.create() | |