Spaces:
Running on Zero
Running on Zero
xinjie.wang commited on
Commit ·
e3586fb
1
Parent(s): 7e484a7
update
Browse files- README.md +1 -1
- app.py +1 -1
- common.py +1 -3
- embodied_gen/models/sam3d.py +0 -2
- embodied_gen/utils/monkey_patch/gradio.py +1 -2
- requirements.txt +2 -2
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🖼️
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: red
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
|
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: red
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 6.8.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
app.py
CHANGED
|
@@ -19,7 +19,7 @@ import os
|
|
| 19 |
|
| 20 |
# GRADIO_APP == "imageto3d_sam3d", sam3d object model, by default.
|
| 21 |
# GRADIO_APP == "imageto3d", TRELLIS model.
|
| 22 |
-
os.environ["GRADIO_APP"] = "
|
| 23 |
from glob import glob
|
| 24 |
|
| 25 |
import gradio as gr
|
|
|
|
| 19 |
|
| 20 |
# GRADIO_APP == "imageto3d_sam3d", sam3d object model, by default.
|
| 21 |
# GRADIO_APP == "imageto3d", TRELLIS model.
|
| 22 |
+
os.environ["GRADIO_APP"] = "imageto3d_sam3d"
|
| 23 |
from glob import glob
|
| 24 |
|
| 25 |
import gradio as gr
|
common.py
CHANGED
|
@@ -16,10 +16,8 @@
|
|
| 16 |
|
| 17 |
import spaces
|
| 18 |
from embodied_gen.utils.monkey_patch.trellis import monkey_path_trellis
|
| 19 |
-
|
| 20 |
monkey_path_trellis()
|
| 21 |
-
from embodied_gen.utils.monkey_patch.gradio import
|
| 22 |
-
_patch_gradio_schema_bool_bug()
|
| 23 |
_patch_open3d_cuda_device_count_bug()
|
| 24 |
|
| 25 |
import gc
|
|
|
|
| 16 |
|
| 17 |
import spaces
|
| 18 |
from embodied_gen.utils.monkey_patch.trellis import monkey_path_trellis
|
|
|
|
| 19 |
monkey_path_trellis()
|
| 20 |
+
from embodied_gen.utils.monkey_patch.gradio import _patch_open3d_cuda_device_count_bug
|
|
|
|
| 21 |
_patch_open3d_cuda_device_count_bug()
|
| 22 |
|
| 23 |
import gc
|
embodied_gen/models/sam3d.py
CHANGED
|
@@ -22,7 +22,6 @@ import sys
|
|
| 22 |
|
| 23 |
import numpy as np
|
| 24 |
from hydra.utils import instantiate
|
| 25 |
-
# from modelscope import snapshot_download
|
| 26 |
from huggingface_hub import snapshot_download
|
| 27 |
from omegaconf import OmegaConf
|
| 28 |
from PIL import Image
|
|
@@ -67,7 +66,6 @@ class Sam3dInference:
|
|
| 67 |
self, local_dir: str = "weights/sam-3d-objects", compile: bool = False, device: str = "cuda",
|
| 68 |
) -> None:
|
| 69 |
if not os.path.exists(local_dir):
|
| 70 |
-
# snapshot_download("facebook/sam-3d-objects", local_dir=local_dir)
|
| 71 |
snapshot_download("tuandao-zenai/sam-3d-objects", local_dir=local_dir)
|
| 72 |
config_file = os.path.join(local_dir, "checkpoints/pipeline.yaml")
|
| 73 |
config = OmegaConf.load(config_file)
|
|
|
|
| 22 |
|
| 23 |
import numpy as np
|
| 24 |
from hydra.utils import instantiate
|
|
|
|
| 25 |
from huggingface_hub import snapshot_download
|
| 26 |
from omegaconf import OmegaConf
|
| 27 |
from PIL import Image
|
|
|
|
| 66 |
self, local_dir: str = "weights/sam-3d-objects", compile: bool = False, device: str = "cuda",
|
| 67 |
) -> None:
|
| 68 |
if not os.path.exists(local_dir):
|
|
|
|
| 69 |
snapshot_download("tuandao-zenai/sam-3d-objects", local_dir=local_dir)
|
| 70 |
config_file = os.path.join(local_dir, "checkpoints/pipeline.yaml")
|
| 71 |
config = OmegaConf.load(config_file)
|
embodied_gen/utils/monkey_patch/gradio.py
CHANGED
|
@@ -18,10 +18,9 @@
|
|
| 18 |
import gradio_client.utils as gradio_client_utils
|
| 19 |
import fileinput
|
| 20 |
import site
|
| 21 |
-
from pathlib import Path
|
| 22 |
|
| 23 |
def _patch_gradio_schema_bool_bug() -> None:
|
| 24 |
-
"""Patch
|
| 25 |
original_get_type = gradio_client_utils.get_type
|
| 26 |
original_json_schema_to_python_type = (
|
| 27 |
gradio_client_utils._json_schema_to_python_type
|
|
|
|
| 18 |
import gradio_client.utils as gradio_client_utils
|
| 19 |
import fileinput
|
| 20 |
import site
|
|
|
|
| 21 |
|
| 22 |
def _patch_gradio_schema_bool_bug() -> None:
|
| 23 |
+
"""Patch schema parser for bool-style for gradio<5.33."""
|
| 24 |
original_get_type = gradio_client_utils.get_type
|
| 25 |
original_json_schema_to_python_type = (
|
| 26 |
gradio_client_utils._json_schema_to_python_type
|
requirements.txt
CHANGED
|
@@ -20,7 +20,8 @@ igraph==0.11.8
|
|
| 20 |
pyvista==0.36.1
|
| 21 |
openai==1.58.1
|
| 22 |
transformers==4.42.4
|
| 23 |
-
gradio==
|
|
|
|
| 24 |
sentencepiece==0.2.0
|
| 25 |
diffusers==0.31.0
|
| 26 |
xatlas==0.0.9
|
|
@@ -31,7 +32,6 @@ basicsr==1.4.2
|
|
| 31 |
realesrgan==0.3.0
|
| 32 |
pydantic
|
| 33 |
vtk==9.3.1
|
| 34 |
-
spaces==0.47.0
|
| 35 |
# utils3d@git+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057d642626897ec8
|
| 36 |
clip@git+https://github.com/openai/CLIP.git
|
| 37 |
kolors@git+https://github.com/Kwai-Kolors/Kolors.git#egg=038818d
|
|
|
|
| 20 |
pyvista==0.36.1
|
| 21 |
openai==1.58.1
|
| 22 |
transformers==4.42.4
|
| 23 |
+
gradio==6.8.0
|
| 24 |
+
spaces==0.47.0
|
| 25 |
sentencepiece==0.2.0
|
| 26 |
diffusers==0.31.0
|
| 27 |
xatlas==0.0.9
|
|
|
|
| 32 |
realesrgan==0.3.0
|
| 33 |
pydantic
|
| 34 |
vtk==9.3.1
|
|
|
|
| 35 |
# utils3d@git+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057d642626897ec8
|
| 36 |
clip@git+https://github.com/openai/CLIP.git
|
| 37 |
kolors@git+https://github.com/Kwai-Kolors/Kolors.git#egg=038818d
|