Use current Extend3D startup behavior
Browse files
app.py
CHANGED
|
@@ -18,16 +18,7 @@ DEFAULT_OUTPUT_DIR = "./output"
|
|
| 18 |
# Pipeline loading
|
| 19 |
# ---------------------------------------------------------------------------
|
| 20 |
|
| 21 |
-
PIPELINE: Extend3D
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
def get_pipeline(progress: gr.Progress) -> Extend3D:
|
| 25 |
-
global PIPELINE
|
| 26 |
-
if PIPELINE is None:
|
| 27 |
-
progress(0, desc="Loading model...")
|
| 28 |
-
PIPELINE = Extend3D.from_pretrained(MODEL_ID).cuda()
|
| 29 |
-
progress(1, desc="Model loaded.")
|
| 30 |
-
return PIPELINE
|
| 31 |
|
| 32 |
# ---------------------------------------------------------------------------
|
| 33 |
# Inference
|
|
@@ -64,7 +55,7 @@ def run_extend3d(
|
|
| 64 |
np.random.seed(seed)
|
| 65 |
random.seed(seed)
|
| 66 |
|
| 67 |
-
pipe =
|
| 68 |
|
| 69 |
output = pipe.run(
|
| 70 |
image_pil,
|
|
@@ -208,5 +199,5 @@ with gr.Blocks(title="Extend3D Demo", css=css) as demo:
|
|
| 208 |
outputs=[preview_video, preview_glb, seed],
|
| 209 |
)
|
| 210 |
|
| 211 |
-
if __name__ == "__main__":
|
| 212 |
-
demo.launch(
|
|
|
|
| 18 |
# Pipeline loading
|
| 19 |
# ---------------------------------------------------------------------------
|
| 20 |
|
| 21 |
+
PIPELINE: Extend3D = Extend3D.from_pretrained(MODEL_ID).cuda()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# ---------------------------------------------------------------------------
|
| 24 |
# Inference
|
|
|
|
| 55 |
np.random.seed(seed)
|
| 56 |
random.seed(seed)
|
| 57 |
|
| 58 |
+
pipe = PIPELINE
|
| 59 |
|
| 60 |
output = pipe.run(
|
| 61 |
image_pil,
|
|
|
|
| 199 |
outputs=[preview_video, preview_glb, seed],
|
| 200 |
)
|
| 201 |
|
| 202 |
+
if __name__ == "__main__":
|
| 203 |
+
demo.launch()
|