Spaces:
Sleeping
Sleeping
Commit
·
48fd666
1
Parent(s):
0f98ba7
added cache examples
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ def create_ds(img_paths):
|
|
49 |
]
|
50 |
return mn.data.Dataset(data_list, transform=mn.transforms.Compose(Ts_list))
|
51 |
|
52 |
-
def make_predictions(img_path, angles=None, cls_batch=None, rotate_to_standard=False, sampler="
|
53 |
|
54 |
global model
|
55 |
global BASELINE_NOISE
|
@@ -131,13 +131,17 @@ with gr.Blocks(css=css_style) as app:
|
|
131 |
examples = [os.path.join("./data/examples", f) for f in os.listdir("./data/examples") if "xr" in f],
|
132 |
inputs = [input_img],
|
133 |
label = "Xray Examples",
|
134 |
-
elem_id='examples'
|
|
|
|
|
135 |
)
|
136 |
gr.Examples(
|
137 |
examples = [os.path.join("./data/examples", f) for f in os.listdir("./data/examples") if "drr" in f],
|
138 |
inputs = [input_img],
|
139 |
label = "DRR Examples",
|
140 |
-
elem_id='examples'
|
|
|
|
|
141 |
)
|
142 |
with gr.Row():
|
143 |
gr.Markdown('Please select an example image, choose your rotation angles, and press Rotate!', elem_classes='text')
|
|
|
49 |
]
|
50 |
return mn.data.Dataset(data_list, transform=mn.transforms.Compose(Ts_list))
|
51 |
|
52 |
+
def make_predictions(img_path, angles=None, cls_batch=None, rotate_to_standard=False, sampler="DDIM5"):
|
53 |
|
54 |
global model
|
55 |
global BASELINE_NOISE
|
|
|
131 |
examples = [os.path.join("./data/examples", f) for f in os.listdir("./data/examples") if "xr" in f],
|
132 |
inputs = [input_img],
|
133 |
label = "Xray Examples",
|
134 |
+
elem_id='examples',
|
135 |
+
cache_examples=True,
|
136 |
+
outputs=output_img
|
137 |
)
|
138 |
gr.Examples(
|
139 |
examples = [os.path.join("./data/examples", f) for f in os.listdir("./data/examples") if "drr" in f],
|
140 |
inputs = [input_img],
|
141 |
label = "DRR Examples",
|
142 |
+
elem_id='examples',
|
143 |
+
cache_examples=True,
|
144 |
+
outputs=output_img
|
145 |
)
|
146 |
with gr.Row():
|
147 |
gr.Markdown('Please select an example image, choose your rotation angles, and press Rotate!', elem_classes='text')
|