Spaces:
Runtime error
Runtime error
pengHTYX
commited on
Commit
·
f9d4406
1
Parent(s):
525296a
'test'
Browse files- app.py +5 -17
- configs/test_unclip-512-6view.yaml +2 -3
app.py
CHANGED
|
@@ -12,22 +12,13 @@ from rembg import remove
|
|
| 12 |
from segment_anything import sam_model_registry, SamPredictor
|
| 13 |
|
| 14 |
import os
|
| 15 |
-
import sys
|
| 16 |
-
import numpy
|
| 17 |
import torch
|
| 18 |
-
|
| 19 |
-
import threading
|
| 20 |
-
import urllib.request
|
| 21 |
from PIL import Image
|
| 22 |
-
from typing import Dict, Optional,
|
| 23 |
from dataclasses import dataclass
|
| 24 |
-
import
|
| 25 |
-
import huggingface_hub
|
| 26 |
-
from transformers import CLIPImageProcessor, CLIPVisionModelWithProjection
|
| 27 |
-
from mvdiffusion.models.unet_mv2d_condition import UNetMV2DConditionModel
|
| 28 |
-
from mvdiffusion.data.single_image_dataset import SingleImageDataset as MVDiffusionDataset
|
| 29 |
from mvdiffusion.pipelines.pipeline_mvdiffusion_unclip import StableUnCLIPImg2ImgPipeline
|
| 30 |
-
from diffusers import AutoencoderKL, DDPMScheduler, DDIMScheduler
|
| 31 |
from einops import rearrange
|
| 32 |
import numpy as np
|
| 33 |
import subprocess
|
|
@@ -157,7 +148,7 @@ def load_era3d_pipeline(cfg):
|
|
| 157 |
# Load scheduler, tokenizer and models.
|
| 158 |
|
| 159 |
pipeline = StableUnCLIPImg2ImgPipeline.from_pretrained(
|
| 160 |
-
|
| 161 |
torch_dtype=weight_dtype
|
| 162 |
)
|
| 163 |
|
|
@@ -257,9 +248,6 @@ def process_3d(mode, data_dir, guidance_scale, crop_size):
|
|
| 257 |
shell=True,
|
| 258 |
)
|
| 259 |
import glob
|
| 260 |
-
# import pdb
|
| 261 |
-
|
| 262 |
-
# pdb.set_trace()
|
| 263 |
|
| 264 |
obj_files = glob.glob(f'{cur_dir}/instant-nsr-pl/exp_demo/{scene}/*/save/*.obj', recursive=True)
|
| 265 |
print(obj_files)
|
|
@@ -271,7 +259,7 @@ def process_3d(mode, data_dir, guidance_scale, crop_size):
|
|
| 271 |
@dataclass
|
| 272 |
class TestConfig:
|
| 273 |
pretrained_model_name_or_path: str
|
| 274 |
-
pretrained_unet_path:str
|
| 275 |
revision: Optional[str]
|
| 276 |
validation_dataset: Dict
|
| 277 |
save_dir: str
|
|
|
|
| 12 |
from segment_anything import sam_model_registry, SamPredictor
|
| 13 |
|
| 14 |
import os
|
|
|
|
|
|
|
| 15 |
import torch
|
| 16 |
+
|
|
|
|
|
|
|
| 17 |
from PIL import Image
|
| 18 |
+
from typing import Dict, Optional, List
|
| 19 |
from dataclasses import dataclass
|
| 20 |
+
from mvdiffusion.data.single_image_dataset import SingleImageDataset
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
from mvdiffusion.pipelines.pipeline_mvdiffusion_unclip import StableUnCLIPImg2ImgPipeline
|
|
|
|
| 22 |
from einops import rearrange
|
| 23 |
import numpy as np
|
| 24 |
import subprocess
|
|
|
|
| 148 |
# Load scheduler, tokenizer and models.
|
| 149 |
|
| 150 |
pipeline = StableUnCLIPImg2ImgPipeline.from_pretrained(
|
| 151 |
+
cfg.pretrained_model_name_or_path,
|
| 152 |
torch_dtype=weight_dtype
|
| 153 |
)
|
| 154 |
|
|
|
|
| 248 |
shell=True,
|
| 249 |
)
|
| 250 |
import glob
|
|
|
|
|
|
|
|
|
|
| 251 |
|
| 252 |
obj_files = glob.glob(f'{cur_dir}/instant-nsr-pl/exp_demo/{scene}/*/save/*.obj', recursive=True)
|
| 253 |
print(obj_files)
|
|
|
|
| 259 |
@dataclass
|
| 260 |
class TestConfig:
|
| 261 |
pretrained_model_name_or_path: str
|
| 262 |
+
pretrained_unet_path:Optional[str]
|
| 263 |
revision: Optional[str]
|
| 264 |
validation_dataset: Dict
|
| 265 |
save_dir: str
|
configs/test_unclip-512-6view.yaml
CHANGED
|
@@ -1,11 +1,10 @@
|
|
| 1 |
-
pretrained_model_name_or_path: '
|
| 2 |
-
pretrained_unet_path: '../checkpoint_backup/output/unit-unclip-512-6view-randomele-self+row-8w-selfcd-rowmv-2block-linear-depthfilter-step-removewh-bs256-three/checkpoint-40000/unet_ema'
|
| 3 |
revision: null
|
| 4 |
|
| 5 |
num_views: 6
|
| 6 |
validation_dataset:
|
| 7 |
prompt_embeds_path: mvdiffusion/data/fixed_prompt_embeds_6view
|
| 8 |
-
root_dir: '
|
| 9 |
num_views: ${num_views}
|
| 10 |
bg_color: 'white'
|
| 11 |
img_wh: [512, 512]
|
|
|
|
| 1 |
+
pretrained_model_name_or_path: 'pengHTYX/MacLab-Era3D-512-6view'
|
|
|
|
| 2 |
revision: null
|
| 3 |
|
| 4 |
num_views: 6
|
| 5 |
validation_dataset:
|
| 6 |
prompt_embeds_path: mvdiffusion/data/fixed_prompt_embeds_6view
|
| 7 |
+
root_dir: 'examples'
|
| 8 |
num_views: ${num_views}
|
| 9 |
bg_color: 'white'
|
| 10 |
img_wh: [512, 512]
|