-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54ab164
commit 74630f9
Showing
8 changed files
with
223 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import gradio as gr | ||
|
||
def trajectoriesArea(submit, parameters): | ||
with gr.Tab(label='Trajectories'): | ||
gr.Markdown(''' | ||
# Trajectories | ||
Here you can visualize the trajectories of the particles. | ||
''') | ||
# number of points, button "Visualize", area for video | ||
numPoints = gr.Slider( | ||
label='Number of sampled points', | ||
value=10, minimum=1, maximum=200, step=1 | ||
) | ||
useOriginalColors = gr.Checkbox(label='Show original colors', value=False) | ||
button = gr.Button(value='Visualize') | ||
video = gr.Video(label='Video', interactive=False) | ||
# Hidden kind parameter | ||
kind = gr.Textbox(label='Kind', value='trajectories', visible=False) | ||
# bind button | ||
submit( | ||
btn=button, | ||
VT_kind=kind, | ||
VT_numPoints=numPoints, | ||
VT_useOriginalColors=useOriginalColors, | ||
**parameters, | ||
outputs={'video': video} | ||
) | ||
|
||
def imageArea(submit, parameters): | ||
with gr.Tab(label='Image Restoration Process'): | ||
gr.Markdown(''' | ||
# Images | ||
Here you can visualize the image restoration process step by step. | ||
''') | ||
VT_resolution = gr.Slider( | ||
label='Resolution', value=64, minimum=8, maximum=512, step=1 | ||
) | ||
# Radio buttons for the displayed values. 'value' or 'x0 | ||
VT_show = gr.Radio( | ||
label='Show', | ||
choices=['value', 'x0'], value='value', | ||
) | ||
button = gr.Button(value='Visualize') | ||
video = gr.Video(label='Video', interactive=False) | ||
# Hidden kind parameter | ||
kind = gr.Textbox(label='Kind', value='process', visible=False) | ||
# bind button | ||
submit( | ||
btn=button, | ||
VT_kind=kind, | ||
VT_resolution=VT_resolution, | ||
VT_show=VT_show, | ||
**parameters, | ||
outputs={'video': video} | ||
) | ||
|
||
def visualizeArea(submit): | ||
with gr.Accordion('Visualize Area', open=False): | ||
fps = gr.Slider(label='Frames per second', value=2, minimum=1, maximum=30, step=1) | ||
VT_seed = gr.Number( | ||
label='Seed (-1 for random)', value=-1, | ||
minimum=-1, maximum=1000000, step=1, interactive=True | ||
) | ||
VT_initialValues = gr.Radio( | ||
label='Initial values', | ||
choices=['Seeded', 'Zeros'], value='Seeded', | ||
) | ||
|
||
parameters = dict( | ||
VT_fps=fps, | ||
VT_initialValues=VT_initialValues, | ||
VT_seed=VT_seed, | ||
) | ||
trajectoriesArea(submit, parameters) | ||
imageArea(submit, parameters) | ||
pass | ||
return |
Oops, something went wrong.