Spaces:
Build error
Build error
Commit
Β·
00687dd
1
Parent(s):
ad7bc89
fix bugs
Browse files- .gitignore +5 -0
- Dockerfile +0 -1
- app.py +3 -0
- pretrained-models/car0/camera.bin +3 -0
- {pretrained_models β pretrained-models}/car0/checkpoints/step=000001600.ckpt +0 -0
- {pretrained_models β pretrained-models}/car0/configs/2024-04-12T21-30-20-lightning.yaml +0 -0
- {pretrained_models β pretrained-models}/car0/configs/2024-04-12T21-30-20-project.yaml +0 -0
- {pretrained_models β pretrained-models}/car0/configs/2024-04-13T11-31-55-lightning.yaml +0 -0
- {pretrained_models β pretrained-models}/car0/configs/2024-04-13T11-31-55-project.yaml +0 -0
- {pretrained_models β pretrained-models}/car0/configs/2024-04-13T11-42-30-lightning.yaml +0 -0
- {pretrained_models β pretrained-models}/car0/configs/2024-04-13T11-42-30-project.yaml +0 -0
- pretrained-models/chair191/camera.bin +3 -0
- {pretrained_models β pretrained-models}/chair191/checkpoints/step=000001600.ckpt +0 -0
- {pretrained_models β pretrained-models}/chair191/configs/2024-04-12T22-10-18-lightning.yaml +0 -0
- {pretrained_models β pretrained-models}/chair191/configs/2024-04-12T22-10-18-project.yaml +0 -0
- pretrained-models/motorcycle12/camera.bin +3 -0
- {pretrained_models β pretrained-models}/motorcycle12/checkpoints/step=000001600.ckpt +0 -0
- {pretrained_models β pretrained-models}/motorcycle12/configs/2024-04-12T23-30-18-project.yaml +0 -0
- pretrained-models/teddybear31/camera.bin +3 -0
- {pretrained_models β pretrained-models}/teddybear31/checkpoints/step=000001600.ckpt +0 -0
- {pretrained_models β pretrained-models}/teddybear31/configs/2024-04-12T22-50-24-lightning.yaml +0 -0
- {pretrained_models β pretrained-models}/teddybear31/configs/2024-04-12T22-50-24-project.yaml +0 -0
- sampling_for_demo.py +0 -9
.gitignore
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# pycache
|
| 2 |
+
__pycache__/
|
| 3 |
+
|
| 4 |
+
# ignore sdxl
|
| 5 |
+
pretrained-models/*.safetensors
|
Dockerfile
CHANGED
|
@@ -26,7 +26,6 @@ ENV HOME=/home/user \
|
|
| 26 |
SYSTEM=spaces
|
| 27 |
|
| 28 |
# Install miniconda
|
| 29 |
-
RUN mkdir -p /home/user/conda
|
| 30 |
ENV CONDA_DIR /home/user/conda
|
| 31 |
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
|
| 32 |
/bin/bash ~/miniconda.sh -b -p /home/user/conda
|
|
|
|
| 26 |
SYSTEM=spaces
|
| 27 |
|
| 28 |
# Install miniconda
|
|
|
|
| 29 |
ENV CONDA_DIR /home/user/conda
|
| 30 |
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
|
| 31 |
/bin/bash ~/miniconda.sh -b -p /home/user/conda
|
app.py
CHANGED
|
@@ -9,6 +9,7 @@ from PIL import Image
|
|
| 9 |
import time
|
| 10 |
import tqdm
|
| 11 |
import copy
|
|
|
|
| 12 |
|
| 13 |
# Mesh imports
|
| 14 |
from pytorch3d.io import load_objs_as_meshes
|
|
@@ -17,6 +18,8 @@ from pytorch3d.transforms import Transform3d, RotateAxisAngle, Translate, Rotate
|
|
| 17 |
|
| 18 |
from sampling_for_demo import load_and_return_model_and_data, sample, load_base_model
|
| 19 |
|
|
|
|
|
|
|
| 20 |
|
| 21 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
| 22 |
|
|
|
|
| 9 |
import time
|
| 10 |
import tqdm
|
| 11 |
import copy
|
| 12 |
+
import sys
|
| 13 |
|
| 14 |
# Mesh imports
|
| 15 |
from pytorch3d.io import load_objs_as_meshes
|
|
|
|
| 18 |
|
| 19 |
from sampling_for_demo import load_and_return_model_and_data, sample, load_base_model
|
| 20 |
|
| 21 |
+
# add current directory to path
|
| 22 |
+
# sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
| 23 |
|
| 24 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
| 25 |
|
pretrained-models/car0/camera.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1fae49a540a313275e795d45b994ed3846f7d443e725bb883881c413dfa95fe2
|
| 3 |
+
size 147296
|
{pretrained_models β pretrained-models}/car0/checkpoints/step=000001600.ckpt
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/car0/configs/2024-04-12T21-30-20-lightning.yaml
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/car0/configs/2024-04-12T21-30-20-project.yaml
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/car0/configs/2024-04-13T11-31-55-lightning.yaml
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/car0/configs/2024-04-13T11-31-55-project.yaml
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/car0/configs/2024-04-13T11-42-30-lightning.yaml
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/car0/configs/2024-04-13T11-42-30-project.yaml
RENAMED
|
File without changes
|
pretrained-models/chair191/camera.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:394dbaf6c87bc98018a2f30c3e901acb3868959065624fc7588986c23abd54b4
|
| 3 |
+
size 147296
|
{pretrained_models β pretrained-models}/chair191/checkpoints/step=000001600.ckpt
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/chair191/configs/2024-04-12T22-10-18-lightning.yaml
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/chair191/configs/2024-04-12T22-10-18-project.yaml
RENAMED
|
File without changes
|
pretrained-models/motorcycle12/camera.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f01c0aaf6a65a6bbe4e4a4e5e028e15e7ebe1bda5db65dd887e55c82b4b141b0
|
| 3 |
+
size 147296
|
{pretrained_models β pretrained-models}/motorcycle12/checkpoints/step=000001600.ckpt
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/motorcycle12/configs/2024-04-12T23-30-18-project.yaml
RENAMED
|
File without changes
|
pretrained-models/teddybear31/camera.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a5e316b57efb602934896dbea3b4ae394320e21c5513fa89beee6cd09adb2447
|
| 3 |
+
size 147296
|
{pretrained_models β pretrained-models}/teddybear31/checkpoints/step=000001600.ckpt
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/teddybear31/configs/2024-04-12T22-50-24-lightning.yaml
RENAMED
|
File without changes
|
{pretrained_models β pretrained-models}/teddybear31/configs/2024-04-12T22-50-24-project.yaml
RENAMED
|
File without changes
|
sampling_for_demo.py
CHANGED
|
@@ -21,15 +21,6 @@ from sgm.util import instantiate_from_config, load_safetensors
|
|
| 21 |
|
| 22 |
choices = []
|
| 23 |
|
| 24 |
-
def append_dims(x, target_dims):
|
| 25 |
-
"""Appends dimensions to the end of a tensor until it has target_dims dimensions."""
|
| 26 |
-
dims_to_append = target_dims - x.ndim
|
| 27 |
-
if dims_to_append < 0:
|
| 28 |
-
raise ValueError(
|
| 29 |
-
f"input has {x.ndim} dims but target_dims is {target_dims}, which is less"
|
| 30 |
-
)
|
| 31 |
-
return x[(...,) + (None,) * dims_to_append]
|
| 32 |
-
|
| 33 |
|
| 34 |
def load_base_model(config, ckpt=None, verbose=True):
|
| 35 |
config = OmegaConf.load(config)
|
|
|
|
| 21 |
|
| 22 |
choices = []
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
def load_base_model(config, ckpt=None, verbose=True):
|
| 26 |
config = OmegaConf.load(config)
|