lemonaddie
commited on
Commit
•
045e1f1
1
Parent(s):
364b7d0
Update app.py
Browse files
app.py
CHANGED
@@ -62,12 +62,8 @@ def process(
|
|
62 |
|
63 |
def run_demo_server(pipe):
|
64 |
process_pipe = functools.partial(process, pipe)
|
65 |
-
|
66 |
-
print(1)
|
67 |
|
68 |
os.environ["GRADIO_ALLOW_FLAGGING"] = "never"
|
69 |
-
|
70 |
-
print(2)
|
71 |
|
72 |
with gr.Blocks(
|
73 |
analytics_enabled=False,
|
@@ -162,102 +158,102 @@ def run_demo_server(pipe):
|
|
162 |
)
|
163 |
|
164 |
demo_3d = gr.Row(render=False)
|
165 |
-
with demo_3d:
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
|
262 |
blocks_settings_depth = [ensemble_size, denoise_steps, processing_res]
|
263 |
blocks_settings_3d = [plane_near, plane_far, embossing, size_longest_px, size_longest_cm, filter_size,
|
@@ -401,6 +397,4 @@ def main():
|
|
401 |
|
402 |
|
403 |
if __name__ == "__main__":
|
404 |
-
main()
|
405 |
-
# 1
|
406 |
-
# 2
|
|
|
62 |
|
63 |
def run_demo_server(pipe):
|
64 |
process_pipe = functools.partial(process, pipe)
|
|
|
|
|
65 |
|
66 |
os.environ["GRADIO_ALLOW_FLAGGING"] = "never"
|
|
|
|
|
67 |
|
68 |
with gr.Blocks(
|
69 |
analytics_enabled=False,
|
|
|
158 |
)
|
159 |
|
160 |
demo_3d = gr.Row(render=False)
|
161 |
+
# with demo_3d:
|
162 |
+
# with gr.Column():
|
163 |
+
# with gr.Accordion("3D printing demo: Main options", open=True):
|
164 |
+
# plane_near = gr.Slider(
|
165 |
+
# label="Relative position of the near plane (between 0 and 1)",
|
166 |
+
# minimum=0.0,
|
167 |
+
# maximum=1.0,
|
168 |
+
# step=0.001,
|
169 |
+
# value=0.0,
|
170 |
+
# )
|
171 |
+
# plane_far = gr.Slider(
|
172 |
+
# label="Relative position of the far plane (between near and 1)",
|
173 |
+
# minimum=0.0,
|
174 |
+
# maximum=1.0,
|
175 |
+
# step=0.001,
|
176 |
+
# value=1.0,
|
177 |
+
# )
|
178 |
+
# embossing = gr.Slider(
|
179 |
+
# label="Embossing level",
|
180 |
+
# minimum=0,
|
181 |
+
# maximum=100,
|
182 |
+
# step=1,
|
183 |
+
# value=20,
|
184 |
+
# )
|
185 |
+
# with gr.Accordion("3D printing demo: Advanced options", open=False):
|
186 |
+
# size_longest_px = gr.Slider(
|
187 |
+
# label="Size (px) of the longest side",
|
188 |
+
# minimum=256,
|
189 |
+
# maximum=1024,
|
190 |
+
# step=256,
|
191 |
+
# value=512,
|
192 |
+
# )
|
193 |
+
# size_longest_cm = gr.Slider(
|
194 |
+
# label="Size (cm) of the longest side",
|
195 |
+
# minimum=1,
|
196 |
+
# maximum=100,
|
197 |
+
# step=1,
|
198 |
+
# value=10,
|
199 |
+
# )
|
200 |
+
# filter_size = gr.Slider(
|
201 |
+
# label="Size (px) of the smoothing filter",
|
202 |
+
# minimum=1,
|
203 |
+
# maximum=5,
|
204 |
+
# step=2,
|
205 |
+
# value=3,
|
206 |
+
# )
|
207 |
+
# frame_thickness = gr.Slider(
|
208 |
+
# label="Frame thickness",
|
209 |
+
# minimum=0,
|
210 |
+
# maximum=100,
|
211 |
+
# step=1,
|
212 |
+
# value=5,
|
213 |
+
# )
|
214 |
+
# frame_near = gr.Slider(
|
215 |
+
# label="Frame's near plane offset",
|
216 |
+
# minimum=-100,
|
217 |
+
# maximum=100,
|
218 |
+
# step=1,
|
219 |
+
# value=1,
|
220 |
+
# )
|
221 |
+
# frame_far = gr.Slider(
|
222 |
+
# label="Frame's far plane offset",
|
223 |
+
# minimum=1,
|
224 |
+
# maximum=10,
|
225 |
+
# step=1,
|
226 |
+
# value=1,
|
227 |
+
# )
|
228 |
+
# with gr.Row():
|
229 |
+
# submit_3d = gr.Button(value="Create 3D", variant="primary")
|
230 |
+
# clear_3d = gr.Button(value="Clear 3D")
|
231 |
+
# gr.Markdown(
|
232 |
+
# """
|
233 |
+
# <h5 align="center">Pro Tips</h5>
|
234 |
+
# <ol>
|
235 |
+
# <li><b>Re-render with new parameters</b>: Click "Clear 3D" and then "Create 3D".</li>
|
236 |
+
# <li><b>Adjust 3D scale and cut-off focus</b>: Set the frame's near plane offset to the
|
237 |
+
# minimum and use 3D preview to evaluate depth scaling. Repeat until the scale is correct and
|
238 |
+
# everything important is in the focus. Set the optimal value for frame's near
|
239 |
+
# plane offset as a last step.</li>
|
240 |
+
# <li><b>Increase details</b>: Decrease size of the smoothing filter (also increases noise).</li>
|
241 |
+
# </ol>
|
242 |
+
# """
|
243 |
+
# )
|
244 |
+
|
245 |
+
# with gr.Column():
|
246 |
+
# viewer_3d = gr.Model3D(
|
247 |
+
# camera_position=(75.0, 90.0, 1.25),
|
248 |
+
# elem_classes="viewport",
|
249 |
+
# label="3D preview (low-res, relief highlight)",
|
250 |
+
# interactive=False,
|
251 |
+
# )
|
252 |
+
# files_3d = gr.Files(
|
253 |
+
# label="3D model outputs (high-res)",
|
254 |
+
# elem_id="download",
|
255 |
+
# interactive=False,
|
256 |
+
# )
|
257 |
|
258 |
blocks_settings_depth = [ensemble_size, denoise_steps, processing_res]
|
259 |
blocks_settings_3d = [plane_near, plane_far, embossing, size_longest_px, size_longest_cm, filter_size,
|
|
|
397 |
|
398 |
|
399 |
if __name__ == "__main__":
|
400 |
+
main()
|
|
|
|