Spaces:
Runtime error
Runtime error
Upload gradio_app.py
Browse files- gradio_app.py +3 -2
gradio_app.py
CHANGED
@@ -42,7 +42,7 @@ COND_HEIGHT = 512
|
|
42 |
COND_DISTANCE = 2.2
|
43 |
COND_FOVY = 0.591627
|
44 |
BACKGROUND_COLOR = [0.5, 0.5, 0.5]
|
45 |
-
OUTPUT_DIR = "output"
|
46 |
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
47 |
HF_TOKEN = os.getenv("HF_TOKEN", None)
|
48 |
|
@@ -216,7 +216,8 @@ def generate_and_process_3d(image: Image.Image) -> tuple[str | None, str | None]
|
|
216 |
unique_id = str(uuid.uuid4())
|
217 |
filename = f'model_{unique_id}.glb'
|
218 |
output_path = os.path.join(OUTPUT_DIR, filename)
|
219 |
-
public_url = f"https://john6666-image-to-3d-test.hf.space/file={output_path}"
|
|
|
220 |
|
221 |
trimesh_mesh.export(output_path, file_type="glb", include_normals=True)
|
222 |
|
|
|
42 |
COND_DISTANCE = 2.2
|
43 |
COND_FOVY = 0.591627
|
44 |
BACKGROUND_COLOR = [0.5, 0.5, 0.5]
|
45 |
+
OUTPUT_DIR = "./output"
|
46 |
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
47 |
HF_TOKEN = os.getenv("HF_TOKEN", None)
|
48 |
|
|
|
216 |
unique_id = str(uuid.uuid4())
|
217 |
filename = f'model_{unique_id}.glb'
|
218 |
output_path = os.path.join(OUTPUT_DIR, filename)
|
219 |
+
public_url = f"https://john6666-image-to-3d-test.hf.space/gradio_api/file={Path(output_path).resolve()}"
|
220 |
+
print(f"public_url: {public_url}")
|
221 |
|
222 |
trimesh_mesh.export(output_path, file_type="glb", include_normals=True)
|
223 |
|