Spaces:
Sleeping
Sleeping
| from interactive_pipe import interactive_pipeline, interactive | |
| from library import (gen_color, modify_geometry, change_color, | |
| compare_by_splitting, tutorial_pipeline) | |
| # -------------------------------------------------------------- | |
| def add_interactivity(): | |
| # Depending on the level of control you want, | |
| # you can add more or less controls to the pipeline | |
| interactive( | |
| ratio=(0.5, [0., 1.], "Side by Side comparison") | |
| )(compare_by_splitting) | |
| interactive( | |
| bnw=(True, "Black and White") | |
| )(change_color) | |
| interactive( | |
| effect=("flip", ["flip", "mirror", "flip+mirror", "identity"]) | |
| )(modify_geometry) | |
| interactive( | |
| frequency=(80, [1, 100]), | |
| isotropy=(0.8, [0.1, 1.]) | |
| )(gen_color) | |
| def run_interactive_pipeline(backend="gradio", markdown_description="# Tutorial"): | |
| add_interactivity() | |
| playable_tutorial_pipeline = interactive_pipeline( | |
| gui=backend, | |
| cache=True, | |
| markdown_description=markdown_description | |
| )(tutorial_pipeline) | |
| playable_tutorial_pipeline() | |