Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- gradio_demo/gradio_demo.py +11 -31
gradio_demo/gradio_demo.py
CHANGED
|
@@ -15,7 +15,7 @@ import cv2
|
|
| 15 |
import matplotlib.pyplot as pl
|
| 16 |
pl.ion()
|
| 17 |
|
| 18 |
-
|
| 19 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 20 |
weight_dtype = torch.float16
|
| 21 |
torch.backends.cuda.matmul.allow_tf32 = True # for gpu >= Ampere and pytorch >= 1.12
|
|
@@ -60,37 +60,17 @@ def look_at(origin, target, up):
|
|
| 60 |
matrix = np.row_stack((rotation_matrix, [0, 0, 0, 1]))
|
| 61 |
return matrix
|
| 62 |
|
| 63 |
-
CaPE_TYPE = "6DoF"
|
| 64 |
import einops
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
elif CaPE_TYPE == "4DoF":
|
| 76 |
-
import sys
|
| 77 |
-
|
| 78 |
-
sys.path.insert(0, "./4DoF/")
|
| 79 |
-
# use the customized diffusers modules
|
| 80 |
-
from diffusers import DDIMScheduler
|
| 81 |
-
from dataset import get_pose
|
| 82 |
-
from CN_encoder import CN_encoder
|
| 83 |
-
from pipeline_zero1to3 import Zero1to3StableDiffusionPipeline
|
| 84 |
-
else:
|
| 85 |
-
raise ValueError("CaPE_TYPE must be chosen from 4DoF, 6DoF")
|
| 86 |
-
|
| 87 |
-
# from eschernet.diffusers import DDIMScheduler
|
| 88 |
-
# from eschernet.dataset import get_pose
|
| 89 |
-
# from eschernet.CN_encoder import CN_encoder
|
| 90 |
-
# from eschernet.pipeline_zero1to3 import Zero1to3StableDiffusionPipeline
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
pretrained_model_name_or_path = "XY-Xin/N3M3B112G6_6dof_36k" # TODO
|
| 94 |
resolution = 256
|
| 95 |
h,w = resolution,resolution
|
| 96 |
guidance_scale = 3.0
|
|
|
|
| 15 |
import matplotlib.pyplot as pl
|
| 16 |
pl.ion()
|
| 17 |
|
| 18 |
+
CaPE_TYPE = "6DoF"
|
| 19 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 20 |
weight_dtype = torch.float16
|
| 21 |
torch.backends.cuda.matmul.allow_tf32 = True # for gpu >= Ampere and pytorch >= 1.12
|
|
|
|
| 60 |
matrix = np.row_stack((rotation_matrix, [0, 0, 0, 1]))
|
| 61 |
return matrix
|
| 62 |
|
|
|
|
| 63 |
import einops
|
| 64 |
+
import sys
|
| 65 |
+
|
| 66 |
+
sys.path.insert(0, "./6DoF/")
|
| 67 |
+
# use the customized diffusers modules
|
| 68 |
+
from diffusers import DDIMScheduler
|
| 69 |
+
from dataset import get_pose
|
| 70 |
+
from CN_encoder import CN_encoder
|
| 71 |
+
from pipeline_zero1to3 import Zero1to3StableDiffusionPipeline
|
| 72 |
+
|
| 73 |
+
pretrained_model_name_or_path = "kxic/EscherNet_demo" # TODO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
resolution = 256
|
| 75 |
h,w = resolution,resolution
|
| 76 |
guidance_scale = 3.0
|