ruff
Browse files
app.py
CHANGED
|
@@ -57,8 +57,7 @@ def preprocess_image(image: Image.Image) -> Image.Image:
|
|
| 57 |
Returns:
|
| 58 |
Image.Image: The preprocessed image.
|
| 59 |
"""
|
| 60 |
-
|
| 61 |
-
return processed_image
|
| 62 |
|
| 63 |
|
| 64 |
def preprocess_images(images: list[tuple[Image.Image, str]]) -> list[Image.Image]:
|
|
@@ -71,8 +70,7 @@ def preprocess_images(images: list[tuple[Image.Image, str]]) -> list[Image.Image
|
|
| 71 |
List[Image.Image]: The preprocessed images.
|
| 72 |
"""
|
| 73 |
images = [image[0] for image in images]
|
| 74 |
-
|
| 75 |
-
return processed_images
|
| 76 |
|
| 77 |
|
| 78 |
def pack_state(gs: Gaussian, mesh: MeshExtractResult) -> dict:
|
|
@@ -335,7 +333,7 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 335 |
download_glb = gr.DownloadButton(label="Download GLB", interactive=False)
|
| 336 |
download_gs = gr.DownloadButton(label="Download Gaussian", interactive=False)
|
| 337 |
|
| 338 |
-
is_multiimage = gr.State(False)
|
| 339 |
output_buf = gr.State()
|
| 340 |
|
| 341 |
# Example images at the bottom of the page
|
|
@@ -363,11 +361,11 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 363 |
demo.unload(end_session)
|
| 364 |
|
| 365 |
single_image_input_tab.select(
|
| 366 |
-
lambda:
|
| 367 |
outputs=[is_multiimage, single_image_example, multiimage_example],
|
| 368 |
)
|
| 369 |
multiimage_input_tab.select(
|
| 370 |
-
lambda:
|
| 371 |
outputs=[is_multiimage, single_image_example, multiimage_example],
|
| 372 |
)
|
| 373 |
|
|
@@ -401,12 +399,12 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 401 |
],
|
| 402 |
outputs=[output_buf, video_output],
|
| 403 |
).then(
|
| 404 |
-
lambda:
|
| 405 |
outputs=[extract_glb_btn, extract_gs_btn],
|
| 406 |
)
|
| 407 |
|
| 408 |
video_output.clear(
|
| 409 |
-
lambda:
|
| 410 |
outputs=[extract_glb_btn, extract_gs_btn],
|
| 411 |
)
|
| 412 |
|
|
|
|
| 57 |
Returns:
|
| 58 |
Image.Image: The preprocessed image.
|
| 59 |
"""
|
| 60 |
+
return pipeline.preprocess_image(image)
|
|
|
|
| 61 |
|
| 62 |
|
| 63 |
def preprocess_images(images: list[tuple[Image.Image, str]]) -> list[Image.Image]:
|
|
|
|
| 70 |
List[Image.Image]: The preprocessed images.
|
| 71 |
"""
|
| 72 |
images = [image[0] for image in images]
|
| 73 |
+
return [pipeline.preprocess_image(image) for image in images]
|
|
|
|
| 74 |
|
| 75 |
|
| 76 |
def pack_state(gs: Gaussian, mesh: MeshExtractResult) -> dict:
|
|
|
|
| 333 |
download_glb = gr.DownloadButton(label="Download GLB", interactive=False)
|
| 334 |
download_gs = gr.DownloadButton(label="Download Gaussian", interactive=False)
|
| 335 |
|
| 336 |
+
is_multiimage = gr.State(False) # noqa: FBT003
|
| 337 |
output_buf = gr.State()
|
| 338 |
|
| 339 |
# Example images at the bottom of the page
|
|
|
|
| 361 |
demo.unload(end_session)
|
| 362 |
|
| 363 |
single_image_input_tab.select(
|
| 364 |
+
lambda: (False, gr.Row.update(visible=True), gr.Row.update(visible=False)),
|
| 365 |
outputs=[is_multiimage, single_image_example, multiimage_example],
|
| 366 |
)
|
| 367 |
multiimage_input_tab.select(
|
| 368 |
+
lambda: (True, gr.Row.update(visible=False), gr.Row.update(visible=True)),
|
| 369 |
outputs=[is_multiimage, single_image_example, multiimage_example],
|
| 370 |
)
|
| 371 |
|
|
|
|
| 399 |
],
|
| 400 |
outputs=[output_buf, video_output],
|
| 401 |
).then(
|
| 402 |
+
lambda: (gr.Button(interactive=True), gr.Button(interactive=True)),
|
| 403 |
outputs=[extract_glb_btn, extract_gs_btn],
|
| 404 |
)
|
| 405 |
|
| 406 |
video_output.clear(
|
| 407 |
+
lambda: (gr.Button(interactive=False), gr.Button(interactive=False)),
|
| 408 |
outputs=[extract_glb_btn, extract_gs_btn],
|
| 409 |
)
|
| 410 |
|