Spaces:
Running
on
Zero
Running
on
Zero
init
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitignore +155 -0
- app.py +205 -0
- configs/nf7_v3_SNR_rd_size_stroke.yaml +21 -0
- configs/specs_objaverse_total.json +57 -0
- configs/stage2-v2-snr.yaml +25 -0
- examples/3D/345/215/241/351/200/232/347/213/227.webp +0 -0
- examples/astronaut.webp +0 -0
- examples/bulldog.webp +0 -0
- examples/ghost-eating-burger.webp +0 -0
- examples/kunkun.webp +0 -0
- examples//344/270/207/345/234/243/345/215/227/347/223/234.webp +0 -0
- examples//344/272/214/346/254/241/345/205/203/345/245/263/345/255/251.webp +0 -0
- examples//344/272/214/346/254/241/345/205/203/345/245/263/345/255/2512.webp +0 -0
- examples//344/272/272/347/211/251/351/252/221/351/251/254.webp +0 -0
- examples//345/207/257.webp +0 -0
- examples//345/210/235/351/237/263/346/234/252/346/235/245/347/216/251/345/201/266.webp +0 -0
- examples//345/215/241/351/200/232/346/201/220/351/276/231.webp +0 -0
- examples//345/215/241/351/200/232/346/211/213/346/236/252/346/210/252/345/233/276.webp +0 -0
- examples//345/215/241/351/200/232/347/214/253.webp +0 -0
- examples//345/215/241/351/200/232/350/230/221/350/217/207/345/245/227/350/243/205.webp +0 -0
- examples//345/217/257/347/210/261/347/216/204/347/255/226.webp +0 -0
- examples//345/244/247/345/244/264/346/263/241/346/263/241/351/251/254/347/211/271.webp +0 -0
- examples//345/275/251/350/211/262/350/230/221/350/217/207.webp +0 -0
- examples//345/275/251/350/211/262/350/230/221/350/217/2072.webp +0 -0
- examples//346/201/220/351/276/231/345/245/227/350/243/205.webp +0 -0
- examples//346/211/213/345/212/236.webp +0 -0
- examples//346/234/272/346/242/260/347/213/227/350/243/201/345/210/207.webp +0 -0
- examples//346/236/227/345/205/213.webp +0 -0
- examples//346/244/215/347/211/2511.webp +0 -0
- examples//346/257/233/347/272/277/350/241/243.webp +0 -0
- examples//346/265/267/351/276/237.webp +0 -0
- examples//347/214/253/344/272/272.webp +0 -0
- examples//347/214/253/345/244/264/351/271/260.webp +0 -0
- examples//347/216/251/345/205/267/345/205/224.webp +0 -0
- examples//347/216/251/345/205/267/347/206/212.webp +0 -0
- examples//347/216/251/345/205/267/347/214/252.webp +0 -0
- examples//347/216/253/347/221/260.webp +0 -0
- examples//347/232/256/345/215/241/344/270/230.webp +0 -0
- examples//347/232/256/351/236/213.webp +0 -0
- examples//347/237/263/345/244/264.webp +0 -0
- examples//347/237/263/345/244/264/345/223/206/345/225/246A/346/242/246.webp +0 -0
- examples//347/272/242/347/216/251/345/205/267/347/214/252.webp +0 -0
- examples//347/277/205/350/206/200/351/201/223/345/205/267.webp +0 -0
- examples//350/215/211/347/263/273/347/262/276/347/201/265.webp +0 -0
- examples//350/223/235/350/211/262/345/260/217/346/200/252/347/211/251.webp +0 -0
- examples//350/223/235/350/211/262/346/263/241/346/263/241/351/251/254/347/211/271.webp +0 -0
- examples//350/223/235/350/211/262/347/214/253.webp +0 -0
- examples//350/265/233/345/215/232/346/234/213/345/205/213-/347/224/267.webp +0 -0
- examples//350/277/220/345/212/250/347/263/273/346/211/213/345/212/236.webp +0 -0
- examples//351/253/230/350/276/276.webp +0 -0
.gitignore
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Byte-compiled / optimized / DLL files
|
2 |
+
__pycache__/
|
3 |
+
*.py[cod]
|
4 |
+
*$py.class
|
5 |
+
|
6 |
+
# C extensions
|
7 |
+
*.so
|
8 |
+
|
9 |
+
# Distribution / packaging
|
10 |
+
.Python
|
11 |
+
build/
|
12 |
+
develop-eggs/
|
13 |
+
dist/
|
14 |
+
downloads/
|
15 |
+
eggs/
|
16 |
+
.eggs/
|
17 |
+
lib/
|
18 |
+
lib64/
|
19 |
+
parts/
|
20 |
+
sdist/
|
21 |
+
var/
|
22 |
+
wheels/
|
23 |
+
share/python-wheels/
|
24 |
+
*.egg-info/
|
25 |
+
.installed.cfg
|
26 |
+
*.egg
|
27 |
+
MANIFEST
|
28 |
+
|
29 |
+
# PyInstaller
|
30 |
+
# Usually these files are written by a python script from a template
|
31 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
32 |
+
*.manifest
|
33 |
+
*.spec
|
34 |
+
|
35 |
+
# Installer logs
|
36 |
+
pip-log.txt
|
37 |
+
pip-delete-this-directory.txt
|
38 |
+
|
39 |
+
# Unit test / coverage reports
|
40 |
+
htmlcov/
|
41 |
+
.tox/
|
42 |
+
.nox/
|
43 |
+
.coverage
|
44 |
+
.coverage.*
|
45 |
+
.cache
|
46 |
+
nosetests.xml
|
47 |
+
coverage.xml
|
48 |
+
*.cover
|
49 |
+
*.py,cover
|
50 |
+
.hypothesis/
|
51 |
+
.pytest_cache/
|
52 |
+
cover/
|
53 |
+
|
54 |
+
# Translations
|
55 |
+
*.mo
|
56 |
+
*.pot
|
57 |
+
|
58 |
+
# Django stuff:
|
59 |
+
*.log
|
60 |
+
local_settings.py
|
61 |
+
db.sqlite3
|
62 |
+
db.sqlite3-journal
|
63 |
+
|
64 |
+
# Flask stuff:
|
65 |
+
instance/
|
66 |
+
.webassets-cache
|
67 |
+
|
68 |
+
# Scrapy stuff:
|
69 |
+
.scrapy
|
70 |
+
|
71 |
+
# Sphinx documentation
|
72 |
+
docs/_build/
|
73 |
+
|
74 |
+
# PyBuilder
|
75 |
+
.pybuilder/
|
76 |
+
target/
|
77 |
+
|
78 |
+
# Jupyter Notebook
|
79 |
+
.ipynb_checkpoints
|
80 |
+
|
81 |
+
# IPython
|
82 |
+
profile_default/
|
83 |
+
ipython_config.py
|
84 |
+
|
85 |
+
# pyenv
|
86 |
+
# For a library or package, you might want to ignore these files since the code is
|
87 |
+
# intended to run in multiple environments; otherwise, check them in:
|
88 |
+
# .python-version
|
89 |
+
|
90 |
+
# pipenv
|
91 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
92 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
93 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
94 |
+
# install all needed dependencies.
|
95 |
+
#Pipfile.lock
|
96 |
+
|
97 |
+
# poetry
|
98 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
99 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
100 |
+
# commonly ignored for libraries.
|
101 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
102 |
+
#poetry.lock
|
103 |
+
|
104 |
+
# pdm
|
105 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
106 |
+
#pdm.lock
|
107 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
108 |
+
# in version control.
|
109 |
+
# https://pdm.fming.dev/#use-with-ide
|
110 |
+
.pdm.toml
|
111 |
+
|
112 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
113 |
+
__pypackages__/
|
114 |
+
|
115 |
+
# Celery stuff
|
116 |
+
celerybeat-schedule
|
117 |
+
celerybeat.pid
|
118 |
+
|
119 |
+
# SageMath parsed files
|
120 |
+
*.sage.py
|
121 |
+
|
122 |
+
# Environments
|
123 |
+
.env
|
124 |
+
.venv
|
125 |
+
env/
|
126 |
+
venv/
|
127 |
+
ENV/
|
128 |
+
env.bak/
|
129 |
+
venv.bak/
|
130 |
+
|
131 |
+
# Spyder project settings
|
132 |
+
.spyderproject
|
133 |
+
.spyproject
|
134 |
+
|
135 |
+
# Rope project settings
|
136 |
+
.ropeproject
|
137 |
+
|
138 |
+
# mkdocs documentation
|
139 |
+
/site
|
140 |
+
|
141 |
+
# mypy
|
142 |
+
.mypy_cache/
|
143 |
+
.dmypy.json
|
144 |
+
dmypy.json
|
145 |
+
|
146 |
+
# Pyre type checker
|
147 |
+
.pyre/
|
148 |
+
|
149 |
+
# pytype static type analyzer
|
150 |
+
.pytype/
|
151 |
+
|
152 |
+
# Cython debug symbols
|
153 |
+
cython_debug/
|
154 |
+
|
155 |
+
|
app.py
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Not ready to use yet
|
2 |
+
import argparse
|
3 |
+
import numpy as np
|
4 |
+
import gradio as gr
|
5 |
+
from omegaconf import OmegaConf
|
6 |
+
import torch
|
7 |
+
from PIL import Image
|
8 |
+
import PIL
|
9 |
+
from pipelines import TwoStagePipeline
|
10 |
+
from huggingface_hub import hf_hub_download
|
11 |
+
import os
|
12 |
+
import rembg
|
13 |
+
from typing import Any
|
14 |
+
import json
|
15 |
+
import os
|
16 |
+
import json
|
17 |
+
import argparse
|
18 |
+
|
19 |
+
from model import CRM
|
20 |
+
from inference import generate3d
|
21 |
+
|
22 |
+
pipeline = None
|
23 |
+
rembg_session = rembg.new_session()
|
24 |
+
|
25 |
+
|
26 |
+
def check_input_image(input_image):
|
27 |
+
if input_image is None:
|
28 |
+
raise gr.Error("No image uploaded!")
|
29 |
+
|
30 |
+
|
31 |
+
def remove_background(
|
32 |
+
image: PIL.Image.Image,
|
33 |
+
rembg_session: Any = None,
|
34 |
+
force: bool = False,
|
35 |
+
**rembg_kwargs,
|
36 |
+
) -> PIL.Image.Image:
|
37 |
+
do_remove = True
|
38 |
+
if image.mode == "RGBA" and image.getextrema()[3][0] < 255:
|
39 |
+
# explain why current do not rm bg
|
40 |
+
print("alhpa channl not enpty, skip remove background, using alpha channel as mask")
|
41 |
+
background = Image.new("RGBA", image.size, (0, 0, 0, 0))
|
42 |
+
image = Image.alpha_composite(background, image)
|
43 |
+
do_remove = False
|
44 |
+
do_remove = do_remove or force
|
45 |
+
if do_remove:
|
46 |
+
image = rembg.remove(image, session=rembg_session, **rembg_kwargs)
|
47 |
+
return image
|
48 |
+
|
49 |
+
def do_resize_content(original_image: Image, scale_rate):
|
50 |
+
# resize image content wile retain the original image size
|
51 |
+
if scale_rate != 1:
|
52 |
+
# Calculate the new size after rescaling
|
53 |
+
new_size = tuple(int(dim * scale_rate) for dim in original_image.size)
|
54 |
+
# Resize the image while maintaining the aspect ratio
|
55 |
+
resized_image = original_image.resize(new_size)
|
56 |
+
# Create a new image with the original size and black background
|
57 |
+
padded_image = Image.new("RGBA", original_image.size, (0, 0, 0, 0))
|
58 |
+
paste_position = ((original_image.width - resized_image.width) // 2, (original_image.height - resized_image.height) // 2)
|
59 |
+
padded_image.paste(resized_image, paste_position)
|
60 |
+
return padded_image
|
61 |
+
else:
|
62 |
+
return original_image
|
63 |
+
|
64 |
+
def add_background(image, bg_color=(255, 255, 255)):
|
65 |
+
# given an RGBA image, alpha channel is used as mask to add background color
|
66 |
+
background = Image.new("RGBA", image.size, bg_color)
|
67 |
+
return Image.alpha_composite(background, image)
|
68 |
+
|
69 |
+
|
70 |
+
def preprocess_image(input_image, do_remove_background, force_remove, foreground_ratio, backgroud_color):
|
71 |
+
"""
|
72 |
+
input image is a pil image in RGBA, return RGB image
|
73 |
+
"""
|
74 |
+
if do_remove_background:
|
75 |
+
image = remove_background(input_image, rembg_session, force_remove)
|
76 |
+
image = do_resize_content(image, foreground_ratio)
|
77 |
+
image = add_background(image, backgroud_color)
|
78 |
+
return image.convert("RGB")
|
79 |
+
|
80 |
+
|
81 |
+
def gen_image(input_image, seed, scale, step):
|
82 |
+
global pipeline, model, args
|
83 |
+
pipeline.set_seed(seed)
|
84 |
+
rt_dict = pipeline(input_image, scale=scale, step=step)
|
85 |
+
stage1_images = rt_dict["stage1_images"]
|
86 |
+
stage2_images = rt_dict["stage2_images"]
|
87 |
+
np_imgs = np.concatenate(stage1_images, 1)
|
88 |
+
np_xyzs = np.concatenate(stage2_images, 1)
|
89 |
+
|
90 |
+
glb_path, obj_path = generate3d(model, np_imgs, np_xyzs, args.device)
|
91 |
+
return Image.fromarray(np_imgs), Image.fromarray(np_xyzs), glb_path, obj_path
|
92 |
+
|
93 |
+
|
94 |
+
parser = argparse.ArgumentParser()
|
95 |
+
parser.add_argument(
|
96 |
+
"--stage1_config",
|
97 |
+
type=str,
|
98 |
+
default="configs/nf7_v3_SNR_rd_size_stroke.yaml",
|
99 |
+
help="config for stage1",
|
100 |
+
)
|
101 |
+
parser.add_argument(
|
102 |
+
"--stage2_config",
|
103 |
+
type=str,
|
104 |
+
default="configs/stage2-v2-snr.yaml",
|
105 |
+
help="config for stage2",
|
106 |
+
)
|
107 |
+
|
108 |
+
parser.add_argument("--device", type=str, default="cuda")
|
109 |
+
args = parser.parse_args()
|
110 |
+
|
111 |
+
crm_path = hf_hub_download(repo_id="Zhengyi/CRM", filename="CRM.pth")
|
112 |
+
specs = json.load(open("configs/specs_objaverse_total.json"))
|
113 |
+
model = CRM(specs).to(args.device)
|
114 |
+
model.load_state_dict(torch.load(crm_path, map_location = args.device), strict=False)
|
115 |
+
|
116 |
+
stage1_config = OmegaConf.load(args.stage1_config).config
|
117 |
+
stage2_config = OmegaConf.load(args.stage2_config).config
|
118 |
+
stage2_sampler_config = stage2_config.sampler
|
119 |
+
stage1_sampler_config = stage1_config.sampler
|
120 |
+
|
121 |
+
stage1_model_config = stage1_config.models
|
122 |
+
stage2_model_config = stage2_config.models
|
123 |
+
|
124 |
+
xyz_path = hf_hub_download(repo_id="Zhengyi/CRM", filename="ccm-diffusion.pth")
|
125 |
+
pixel_path = hf_hub_download(repo_id="Zhengyi/CRM", filename="pixel-diffusion.pth")
|
126 |
+
stage1_model_config.resume = pixel_path
|
127 |
+
stage2_model_config.resume = xyz_path
|
128 |
+
|
129 |
+
pipeline = TwoStagePipeline(
|
130 |
+
stage1_model_config,
|
131 |
+
stage2_model_config,
|
132 |
+
stage1_sampler_config,
|
133 |
+
stage2_sampler_config,
|
134 |
+
device=args.device,
|
135 |
+
dtype=torch.float16
|
136 |
+
)
|
137 |
+
|
138 |
+
with gr.Blocks() as demo:
|
139 |
+
gr.Markdown("# CRM: Single Image to 3D Textured Mesh with Convolutional Reconstruction Model")
|
140 |
+
with gr.Row():
|
141 |
+
with gr.Column():
|
142 |
+
with gr.Row():
|
143 |
+
image_input = gr.Image(
|
144 |
+
label="Image input",
|
145 |
+
image_mode="RGBA",
|
146 |
+
sources="upload",
|
147 |
+
type="pil",
|
148 |
+
)
|
149 |
+
processed_image = gr.Image(label="Processed Image", interactive=False, type="pil", image_mode="RGB")
|
150 |
+
with gr.Row():
|
151 |
+
with gr.Column():
|
152 |
+
with gr.Row():
|
153 |
+
do_remove_background = gr.Checkbox(label="Remove Background", value=True)
|
154 |
+
force_remove = gr.Checkbox(label="Force Remove", value=False)
|
155 |
+
back_groud_color = gr.ColorPicker(label="Background Color", value="#7F7F7F", interactive=False)
|
156 |
+
foreground_ratio = gr.Slider(
|
157 |
+
label="Foreground Ratio",
|
158 |
+
minimum=0.5,
|
159 |
+
maximum=1.0,
|
160 |
+
value=1.0,
|
161 |
+
step=0.05,
|
162 |
+
)
|
163 |
+
|
164 |
+
with gr.Column():
|
165 |
+
seed = gr.Number(value=1234, label="seed", precision=0)
|
166 |
+
guidance_scale = gr.Number(value=5.5, minimum=0, maximum=20, label="guidance_scale")
|
167 |
+
step = gr.Number(value=50, minimum=1, maximum=100, label="sample steps", precision=0)
|
168 |
+
text_button = gr.Button("Generate Images")
|
169 |
+
with gr.Column():
|
170 |
+
image_output = gr.Image(interactive=False, label="Output RGB image")
|
171 |
+
xyz_ouput = gr.Image(interactive=False, label="Output CCM image")
|
172 |
+
|
173 |
+
output_model = gr.Model3D(
|
174 |
+
label="Output GLB",
|
175 |
+
interactive=False,
|
176 |
+
)
|
177 |
+
output_obj = gr.File(interactive=False, label="Output OBJ")
|
178 |
+
|
179 |
+
inputs = [
|
180 |
+
processed_image,
|
181 |
+
seed,
|
182 |
+
guidance_scale,
|
183 |
+
step,
|
184 |
+
]
|
185 |
+
outputs = [
|
186 |
+
image_output,
|
187 |
+
xyz_ouput,
|
188 |
+
output_model,
|
189 |
+
output_obj,
|
190 |
+
]
|
191 |
+
gr.Examples(
|
192 |
+
examples=[os.path.join("examples", i) for i in os.listdir("examples")],
|
193 |
+
inputs=[image_input],
|
194 |
+
)
|
195 |
+
|
196 |
+
text_button.click(fn=check_input_image, inputs=[image_input]).success(
|
197 |
+
fn=preprocess_image,
|
198 |
+
inputs=[image_input, do_remove_background, force_remove, foreground_ratio, back_groud_color],
|
199 |
+
outputs=[processed_image],
|
200 |
+
).success(
|
201 |
+
fn=gen_image,
|
202 |
+
inputs=inputs,
|
203 |
+
outputs=outputs,
|
204 |
+
)
|
205 |
+
demo.queue().launch()
|
configs/nf7_v3_SNR_rd_size_stroke.yaml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
config:
|
2 |
+
# others
|
3 |
+
seed: 1234
|
4 |
+
num_frames: 7
|
5 |
+
mode: pixel
|
6 |
+
offset_noise: true
|
7 |
+
# model related
|
8 |
+
models:
|
9 |
+
config: imagedream/configs/sd_v2_base_ipmv_zero_SNR.yaml
|
10 |
+
resume: models/pixel.pth
|
11 |
+
# sampler related
|
12 |
+
sampler:
|
13 |
+
target: libs.sample.ImageDreamDiffusion
|
14 |
+
params:
|
15 |
+
mode: pixel
|
16 |
+
num_frames: 7
|
17 |
+
camera_views: [1, 2, 3, 4, 5, 0, 0]
|
18 |
+
ref_position: 6
|
19 |
+
random_background: false
|
20 |
+
offset_noise: true
|
21 |
+
resize_rate: 1.0
|
configs/specs_objaverse_total.json
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"Input": {
|
3 |
+
"img_num": 16,
|
4 |
+
"class": "all",
|
5 |
+
"camera_angle_num": 8,
|
6 |
+
"tet_grid_size": 80,
|
7 |
+
"validate_num": 16,
|
8 |
+
"scale": 0.95,
|
9 |
+
"radius": 3,
|
10 |
+
"resolution": [256, 256]
|
11 |
+
},
|
12 |
+
|
13 |
+
"Pretrain": {
|
14 |
+
"mode": null,
|
15 |
+
"sdf_threshold": 0.1,
|
16 |
+
"sdf_scale": 10,
|
17 |
+
"batch_infer": false,
|
18 |
+
"lr": 1e-4,
|
19 |
+
"radius": 0.5
|
20 |
+
},
|
21 |
+
|
22 |
+
"Train": {
|
23 |
+
"mode": "rnd",
|
24 |
+
"num_epochs": 500,
|
25 |
+
"grad_acc": 1,
|
26 |
+
"warm_up": 0,
|
27 |
+
"decay": 0.000,
|
28 |
+
"learning_rate": {
|
29 |
+
"init": 1e-4,
|
30 |
+
"sdf_decay": 1,
|
31 |
+
"rgb_decay": 1
|
32 |
+
},
|
33 |
+
"batch_size": 4,
|
34 |
+
"eva_iter": 80,
|
35 |
+
"eva_all_epoch": 10,
|
36 |
+
"tex_sup_mode": "blender",
|
37 |
+
"exp_uv_mesh": false,
|
38 |
+
"doub": false,
|
39 |
+
"random_bg": false,
|
40 |
+
"shift": 0,
|
41 |
+
"aug_shift": 0,
|
42 |
+
"geo_type": "flex"
|
43 |
+
},
|
44 |
+
|
45 |
+
"ArchSpecs": {
|
46 |
+
"unet_type": "diffusers",
|
47 |
+
"use_3D_aware": false,
|
48 |
+
"fea_concat": false,
|
49 |
+
"mlp_bias": true
|
50 |
+
},
|
51 |
+
|
52 |
+
"DecoderSpecs": {
|
53 |
+
"c_dim": 32,
|
54 |
+
"plane_resolution": 256
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
configs/stage2-v2-snr.yaml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
config:
|
2 |
+
# others
|
3 |
+
seed: 1234
|
4 |
+
num_frames: 6
|
5 |
+
mode: pixel
|
6 |
+
offset_noise: true
|
7 |
+
gd_type: xyz
|
8 |
+
# model related
|
9 |
+
models:
|
10 |
+
config: imagedream/configs/sd_v2_base_ipmv_chin8_zero_snr.yaml
|
11 |
+
resume: models/xyz.pth
|
12 |
+
|
13 |
+
# eval related
|
14 |
+
sampler:
|
15 |
+
target: libs.sample.ImageDreamDiffusionStage2
|
16 |
+
params:
|
17 |
+
mode: pixel
|
18 |
+
num_frames: 6
|
19 |
+
camera_views: [1, 2, 3, 4, 5, 0]
|
20 |
+
ref_position: null
|
21 |
+
random_background: false
|
22 |
+
offset_noise: true
|
23 |
+
resize_rate: 1.0
|
24 |
+
|
25 |
+
|
examples/3D/345/215/241/351/200/232/347/213/227.webp
ADDED
examples/astronaut.webp
ADDED
examples/bulldog.webp
ADDED
examples/ghost-eating-burger.webp
ADDED
examples/kunkun.webp
ADDED
examples//344/270/207/345/234/243/345/215/227/347/223/234.webp
ADDED
examples//344/272/214/346/254/241/345/205/203/345/245/263/345/255/251.webp
ADDED
examples//344/272/214/346/254/241/345/205/203/345/245/263/345/255/2512.webp
ADDED
examples//344/272/272/347/211/251/351/252/221/351/251/254.webp
ADDED
examples//345/207/257.webp
ADDED
examples//345/210/235/351/237/263/346/234/252/346/235/245/347/216/251/345/201/266.webp
ADDED
examples//345/215/241/351/200/232/346/201/220/351/276/231.webp
ADDED
examples//345/215/241/351/200/232/346/211/213/346/236/252/346/210/252/345/233/276.webp
ADDED
examples//345/215/241/351/200/232/347/214/253.webp
ADDED
examples//345/215/241/351/200/232/350/230/221/350/217/207/345/245/227/350/243/205.webp
ADDED
examples//345/217/257/347/210/261/347/216/204/347/255/226.webp
ADDED
examples//345/244/247/345/244/264/346/263/241/346/263/241/351/251/254/347/211/271.webp
ADDED
examples//345/275/251/350/211/262/350/230/221/350/217/207.webp
ADDED
examples//345/275/251/350/211/262/350/230/221/350/217/2072.webp
ADDED
examples//346/201/220/351/276/231/345/245/227/350/243/205.webp
ADDED
examples//346/211/213/345/212/236.webp
ADDED
examples//346/234/272/346/242/260/347/213/227/350/243/201/345/210/207.webp
ADDED
examples//346/236/227/345/205/213.webp
ADDED
examples//346/244/215/347/211/2511.webp
ADDED
examples//346/257/233/347/272/277/350/241/243.webp
ADDED
examples//346/265/267/351/276/237.webp
ADDED
examples//347/214/253/344/272/272.webp
ADDED
examples//347/214/253/345/244/264/351/271/260.webp
ADDED
examples//347/216/251/345/205/267/345/205/224.webp
ADDED
examples//347/216/251/345/205/267/347/206/212.webp
ADDED
examples//347/216/251/345/205/267/347/214/252.webp
ADDED
examples//347/216/253/347/221/260.webp
ADDED
examples//347/232/256/345/215/241/344/270/230.webp
ADDED
examples//347/232/256/351/236/213.webp
ADDED
examples//347/237/263/345/244/264.webp
ADDED
examples//347/237/263/345/244/264/345/223/206/345/225/246A/346/242/246.webp
ADDED
examples//347/272/242/347/216/251/345/205/267/347/214/252.webp
ADDED
examples//347/277/205/350/206/200/351/201/223/345/205/267.webp
ADDED
examples//350/215/211/347/263/273/347/262/276/347/201/265.webp
ADDED
examples//350/223/235/350/211/262/345/260/217/346/200/252/347/211/251.webp
ADDED
examples//350/223/235/350/211/262/346/263/241/346/263/241/351/251/254/347/211/271.webp
ADDED
examples//350/223/235/350/211/262/347/214/253.webp
ADDED
examples//350/265/233/345/215/232/346/234/213/345/205/213-/347/224/267.webp
ADDED
examples//350/277/220/345/212/250/347/263/273/346/211/213/345/212/236.webp
ADDED
examples//351/253/230/350/276/276.webp
ADDED