Chao Xu commited on
Commit
f79ddf6
β€’
1 Parent(s): 3c4eaa2

Update README and release inference code

Browse files
Files changed (4) hide show
  1. README.md +23 -4
  2. app.py +8 -10
  3. pre-requirements.txt +0 -67
  4. requirements.txt +62 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ“ΈπŸš€πŸŒŸ
4
  colorFrom: red
5
  colorTo: yellow
6
  sdk: gradio
7
- sdk_version: 3.40.0
8
  app_file: app.py
9
  pinned: true
10
  license: mit
@@ -12,10 +12,29 @@ license: mit
12
 
13
  # One-2-3-45: Any Single Image to 3D Mesh in 45 Seconds without Per-Shape Optimization
14
 
15
- Paper: https://arxiv.org/abs/2306.16928
16
- Code: https://github.com/One-2-3-45/One-2-3-45
 
 
 
17
 
18
- ## BibTeX
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  ```bibtex
21
  @misc{liu2023one2345,
 
4
  colorFrom: red
5
  colorTo: yellow
6
  sdk: gradio
7
+ sdk_version: 3.40.1
8
  app_file: app.py
9
  pinned: true
10
  license: mit
 
12
 
13
  # One-2-3-45: Any Single Image to 3D Mesh in 45 Seconds without Per-Shape Optimization
14
 
15
+ <div>
16
+ <a style="display:inline-block" href="http://one-2-3-45.com"><img src="https://img.shields.io/badge/Project_Homepage-f9f7f7?logo=data:image/webp;base64,UklGRmIRAABXRUJQVlA4IFYRAABQPwCdASrIAMgAPm00lEekpiolqDvpMIANiWJu3pE7maI+vTDkhN5f7PfmGT7nS6p8nKBr0I+YBzr/ML+2/rG/8j1Sf3/1AP6v/sOsW/bn2GP2W9Zv/zeyf/cf+Z+63tReoB/6uCx2p5E/iUkPwG1FO9t/XgHPL7RH7TzI8EvEA4Mr1T2CP0J6xH+d5J/rz2F/LG9h37l+x9+4xQ3m86D2Te/zeVV/tWyTw7s85XZ0ABD4N2CpzWHt8feKiWkqdTkRjojREWrbUDAKXlYsV7EGU9rWR2gCxVXnstqpNVhwra603swvYRlMyRzKc5nJHEEeLuV8EDee/Mp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wXrFfHtdHHrlojW+3BFzE5rOzDsUsA00zYHxt+e9zo9Yn0sImcxGhbDFBGD892Rgz9G+eor3huRF8h4p1qYpjTe/ykVkhWyvHRjNNevOV7Gk1jhgiwOajzrXwNsIJNUvAQQB017GRYgey7MAEeBoAx5RuxYU+oMH6DNk5eYcrJDxo48XGbO4QhCMRgAA"></a>
17
+ <a style="display:inline-block; margin-left: .5em" href="https://arxiv.org/abs/2306.16928"><img src="https://img.shields.io/badge/2306.16928-f9f7f7?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAABMCAYAAADJPi9EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAuIwAALiMBeKU/dgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAa2SURBVHja3Zt7bBRFGMAXUCDGF4rY7m7bAwuhlggKStFgLBgFEkCIIRJEEoOBYHwRFYKilUgEReVNJEGCJJpehHI3M9vZvd3bUP1DjNhEIRQQsQgSHiJgQZ5dv7krWEvvdmZ7d7vHJN+ft/f99pv5XvOtJMFCqvoCUpTdIEeRLC+L9Ox5i3Q9LACaCeK0kXoSChVcD3C/tQPHpAEsquQ73IkUcEz2kcLCknyGW5MGjkljRFVL8xJOKyi4CwCOuQAeAkfTP1+tNxLkogvgEbDgffkJqKqvuMA5ifOpqg/5qWecRstNg7xoUTI1Fovdxg8oy2s5AP8CGeYHmGngeZaOL4I4LXLcpHg4149/GDz4xqgsb+UAbMKKUpkrqHA43MUyyJpWUK0EHeG2YKRXr7tB+QMcgGewLD+ebTDbtrtbBt7UPlhS4rV4IvcDI7J8P1OeA/AcAI7LHljN7aB8XTowJmZt9EFRD/o0SDMH4HlwMhMyDWZZSAHFf3YDs3RS49WDLuaAY3IJq+qzmQKLxXAZKN7oDoYbdV3v5elPqiSpMyiOuAEVZVqHXb1OhloUH+MA+ztO0cAO/RkrfyBE7OAEbAZvO8vzVtTRWFD6DAfY5biBM3PWiaL0a4lvXICwnV8Wjm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Qh42NY0NSdgbLIPlLUF6rEdrdt0CUCK1wsCbkcI3ZSLc7ZSwGLbmJXbPsNxnE5xilYKAobZ77LpGZ8TAIun+/iCKQoF71IxQDI3K2CCd+ARNvXg9sykBcnHAoCZG4u66hlDoQLe6QV4CRtFSxZQ+D0BwNO2jgdkzoGoah1nj3FVlSR19taTSYxI8QLut23U8dsgzqHulJNCQpcqBnpTALCuQ6NSYLHpmR5i42gZzuIdcrMMvMJbQlxe3jXxyZnLACl7ARm/FjPIDOY8ODtpM71sxwfcZpvBeUzKWmfNINM5AS+wO0Khh7dMqKccu4+qatarZjYAwDlgetzStHtEt+XedsBOQtU9XMrRgjg4KTnc5nr+dmqadit/4C4uLm8DuA9koJTj1TL7fI5nDL+qqoo/FLGAzL7dYT17PzvAcQONYSUQRxW/QMrHZVIyik0ZuQA2mzp+Ji8BW4YM3Mbzm9inaHkJCGfrUZZjujiYailfFwA8DHIy3acwUj4v9vUVa+SmgNsl5fuyDTKovW9/IAmfLV0Pi2UncA515kjYdrwC9i9rpuHiq3JwtAAAAABJRU5ErkJggg=="></a>
18
+ <a style="display:inline-block; margin-left: .5em" href='https://github.com/One-2-3-45/One-2-3-45'><img src='https://img.shields.io/github/stars/One-2-3-45/One-2-3-45?style=social' /></a>
19
+ </div>
20
 
21
+
22
+ This space hosts the demo for [One-2-3-45](http://One-2-3-45.com), powered by the [inference model](https://huggingface.co/One-2-3-45/code).
23
+
24
+ Please refer to our [GitHub repo](https://github.com/One-2-3-45/One-2-3-45) for full code release.
25
+
26
+ ## Local Deployment of the Demo
27
+ ```bash
28
+ # Minimum GPU: NVIDIA A10 or RTX 3090
29
+ # 1. Install the requirements
30
+ sudo apt-get install libsparsehash-dev
31
+ pip install -r requirements.txt
32
+
33
+ # 2. Run the demo
34
+ python app.py
35
+ ```
36
+
37
+ ## Citation
38
 
39
  ```bibtex
40
  @misc{liu2023one2345,
app.py CHANGED
@@ -3,26 +3,25 @@ from huggingface_hub import snapshot_download
3
 
4
  is_local_run = False
5
 
6
- code_dir = snapshot_download("One-2-3-45/code", token=os.environ['TOKEN']) if not is_local_run else "../code"
7
 
8
  sys.path.append(code_dir)
9
 
10
- elev_est_dir = os.path.join(code_dir, "one2345_elev_est/")
11
  sys.path.append(elev_est_dir)
12
 
13
  if not is_local_run:
14
- import subprocess
15
- subprocess.run(["sh", os.path.join(elev_est_dir, "install.sh")], cwd=elev_est_dir)
16
  # export TORCH_CUDA_ARCH_LIST="7.0;7.2;8.0;8.6"
17
  # export IABN_FORCE_CUDA=1
18
  os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
19
  os.environ["IABN_FORCE_CUDA"] = "1"
20
  os.environ["FORCE_CUDA"] = "1"
21
- subprocess.run(["pip", "install", "inplace_abn"])
22
  # FORCE_CUDA=1 pip install --no-cache-dir git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0
23
- subprocess.run(["pip", "install", "--no-cache-dir", "git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0"])
24
 
25
- import inspect
26
  import shutil
27
  import torch
28
  import fire
@@ -61,7 +60,7 @@ _BBOX_2 = "Bounding box adjusted. Continue adjusting or **Run Generation**."
61
  _BBOX_3 = "Bounding box predicted. Adjust it using sliders or **Run Generation**."
62
  _SAM = "Preprocessing the input image... (safety check, SAM segmentation, *etc*.)"
63
  _GEN_1 = "Predicting multi-view images... (may take \~13 seconds) <br> Images will be shown in the bottom right blocks."
64
- _GEN_2 = "Predicting nearby views and generating mesh... (may take \~35 seconds) <br> Mesh will be shown on the right."
65
  _DONE = "Done! Mesh is shown on the right. <br> If it is not satisfactory, please select **Retry view** checkboxes for inaccurate views and click **Regenerate selected view(s)** at the bottom."
66
  _REGEN_1 = "Selected view(s) are regenerated. You can click **Regenerate nearby views and mesh**. <br> Alternatively, if the regenerated view(s) are still not satisfactory, you can repeat the previous step (select the view and regenerate)."
67
  _REGEN_2 = "Regeneration done. Mesh is shown on the right."
@@ -361,8 +360,7 @@ def stage2_run(models, device, tmp_dir,
361
  zero123_infer(model, tmp_dir, indices=rerun_all, device=device, ddim_steps=stage2_steps, scale=scale)
362
 
363
  dataset = tmp_dir
364
- main_dir_path = os.path.dirname(os.path.abspath(
365
- inspect.getfile(inspect.currentframe())))
366
  torch.cuda.empty_cache()
367
  os.chdir(os.path.join(code_dir, 'SparseNeuS_demo_v1/'))
368
 
 
3
 
4
  is_local_run = False
5
 
6
+ code_dir = snapshot_download("One-2-3-45/code") if not is_local_run else "../code" # , token=os.environ['TOKEN']
7
 
8
  sys.path.append(code_dir)
9
 
10
+ elev_est_dir = os.path.abspath(os.path.join(code_dir, "one2345_elev_est"))
11
  sys.path.append(elev_est_dir)
12
 
13
  if not is_local_run:
14
+ import pip
15
+ pip.main(['install', elev_est_dir])
16
  # export TORCH_CUDA_ARCH_LIST="7.0;7.2;8.0;8.6"
17
  # export IABN_FORCE_CUDA=1
18
  os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
19
  os.environ["IABN_FORCE_CUDA"] = "1"
20
  os.environ["FORCE_CUDA"] = "1"
21
+ pip.main(["install", "inplace_abn"])
22
  # FORCE_CUDA=1 pip install --no-cache-dir git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0
23
+ pip.main(["install", "--no-cache-dir", "git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0"])
24
 
 
25
  import shutil
26
  import torch
27
  import fire
 
60
  _BBOX_3 = "Bounding box predicted. Adjust it using sliders or **Run Generation**."
61
  _SAM = "Preprocessing the input image... (safety check, SAM segmentation, *etc*.)"
62
  _GEN_1 = "Predicting multi-view images... (may take \~13 seconds) <br> Images will be shown in the bottom right blocks."
63
+ _GEN_2 = "Predicting nearby views and generating mesh... (may take \~33 seconds) <br> Mesh will be shown on the right."
64
  _DONE = "Done! Mesh is shown on the right. <br> If it is not satisfactory, please select **Retry view** checkboxes for inaccurate views and click **Regenerate selected view(s)** at the bottom."
65
  _REGEN_1 = "Selected view(s) are regenerated. You can click **Regenerate nearby views and mesh**. <br> Alternatively, if the regenerated view(s) are still not satisfactory, you can repeat the previous step (select the view and regenerate)."
66
  _REGEN_2 = "Regeneration done. Mesh is shown on the right."
 
360
  zero123_infer(model, tmp_dir, indices=rerun_all, device=device, ddim_steps=stage2_steps, scale=scale)
361
 
362
  dataset = tmp_dir
363
+ main_dir_path = os.path.dirname(__file__)
 
364
  torch.cuda.empty_cache()
365
  os.chdir(os.path.join(code_dir, 'SparseNeuS_demo_v1/'))
366
 
pre-requirements.txt DELETED
@@ -1,67 +0,0 @@
1
- --extra-index-url https://download.pytorch.org/whl/cu118
2
- torch>=2.0.0
3
- torchvision>=0.13.1
4
- albumentations>=0.4.3
5
- opencv-python>=4.5.5.64
6
- pudb>=2019.2
7
- imageio>=2.9.0
8
- imageio-ffmpeg>=0.4.2
9
- pytorch-lightning>=1.4.2
10
- omegaconf>=2.1.1
11
- test-tube>=0.7.5
12
- streamlit>=0.73.1
13
- einops>=0.3.0
14
- torch-fidelity>=0.3.0
15
- transformers>=4.22.2
16
- kornia>=0.6
17
- webdataset>=0.2.5
18
- torchmetrics>=0.6.0
19
- fire>=0.4.0
20
- gradio>=3.21.0
21
- diffusers>=0.12.1
22
- datasets[vision]>=2.4.0
23
- carvekit-colab>=4.1.0
24
- rich>=13.3.2
25
- plotly>=5.13.1
26
- -e git+https://github.com/CompVis/taming-transformers.git#egg=taming-transformers
27
- # elev est
28
- dl_ext
29
- easydict
30
- glumpy
31
- gym
32
- h5py
33
- loguru
34
- matplotlib
35
- # mplib
36
- multipledispatch
37
- open3d
38
- packaging
39
- Pillow
40
- pycocotools
41
- motion-planning
42
- pyrender
43
- PyYAML
44
- scikit_image
45
- scikit_learn
46
- scipy
47
- screeninfo
48
- setuptools
49
- tensorboardX
50
- termcolor
51
- tqdm
52
- transforms3d
53
- trimesh
54
- yacs
55
- # zarr
56
- # sapien
57
- pyglet==1.5.27
58
- # wis3d
59
- gdown
60
- git+https://github.com/NVlabs/nvdiffrast.git
61
- git+https://github.com/openai/CLIP.git
62
- # segment anything
63
- onnxruntime
64
- onnx
65
- git+https://github.com/facebookresearch/segment-anything.git
66
- # rembg
67
- rembg
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,6 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # sparseneus
2
  # -e git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0#egg=torchsparse
3
- numpy
4
  pyhocon
5
  icecream
6
  PyMCubes
 
1
+ --extra-index-url https://download.pytorch.org/whl/cu118
2
+ numpy
3
+ torch>=2.0.0
4
+ torchvision
5
+ albumentations>=0.4.3
6
+ opencv-python>=4.5.5.64
7
+ pudb>=2019.2
8
+ imageio>=2.9.0
9
+ imageio-ffmpeg>=0.4.2
10
+ pytorch-lightning>=1.4.2
11
+ omegaconf>=2.1.1
12
+ test-tube>=0.7.5
13
+ streamlit>=0.73.1
14
+ einops>=0.3.0
15
+ torch-fidelity>=0.3.0
16
+ transformers>=4.22.2
17
+ kornia>=0.6
18
+ webdataset>=0.2.5
19
+ torchmetrics>=0.6.0
20
+ fire>=0.4.0
21
+ gradio>=3.40.1
22
+ diffusers>=0.12.1
23
+ datasets[vision]>=2.4.0
24
+ carvekit-colab>=4.1.0
25
+ rich>=13.3.2
26
+ plotly>=5.13.1
27
+ -e git+https://github.com/CompVis/taming-transformers.git#egg=taming-transformers
28
+ # elev est
29
+ dl_ext
30
+ easydict
31
+ glumpy
32
+ gym
33
+ h5py
34
+ loguru
35
+ matplotlib
36
+ # mplib
37
+ multipledispatch
38
+ packaging
39
+ Pillow
40
+ pycocotools
41
+ motion-planning
42
+ pyrender
43
+ PyYAML
44
+ scikit_image
45
+ scikit_learn
46
+ scipy
47
+ screeninfo
48
+ setuptools
49
+ tensorboardX
50
+ tqdm
51
+ transforms3d
52
+ trimesh
53
+ yacs
54
+ gdown
55
+ git+https://github.com/NVlabs/nvdiffrast.git
56
+ git+https://github.com/openai/CLIP.git
57
+ # segment anything
58
+ onnxruntime
59
+ onnx
60
+ git+https://github.com/facebookresearch/segment-anything.git
61
+ # rembg
62
+ rembg
63
  # sparseneus
64
  # -e git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0#egg=torchsparse
 
65
  pyhocon
66
  icecream
67
  PyMCubes