Spaces:
Runtime error
Runtime error
change pytorch verision to avoid OOM error
Browse files
app.py
CHANGED
@@ -14,7 +14,6 @@ if os.getenv('SYSTEM') == 'spaces':
|
|
14 |
'pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html'.split())
|
15 |
subprocess.run(
|
16 |
'pip install git+https://github.com/YuliangXiu/kaolin.git'.split())
|
17 |
-
# subprocess.run('pip install https://download.is.tue.mpg.de/icon/kaolin-0.11.0-cp38-cp38-linux_x86_64.whl'.split())
|
18 |
subprocess.run('pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1110/download.html'.split())
|
19 |
subprocess.run(
|
20 |
'pip install git+https://github.com/Project-Splinter/human_det.git'.split())
|
@@ -73,7 +72,7 @@ def generate_image(seed, psi):
|
|
73 |
|
74 |
random.seed(1993)
|
75 |
model_types = ['icon-filter', 'pifu', 'pamir']
|
76 |
-
examples = [[item, random.choice(model_types)] for item in sorted(glob.glob('examples/*.png'))]
|
77 |
|
78 |
with gr.Blocks() as demo:
|
79 |
gr.Markdown(description)
|
@@ -123,7 +122,7 @@ with gr.Blocks() as demo:
|
|
123 |
if __name__ == "__main__":
|
124 |
|
125 |
# demo.launch(debug=False, enable_queue=False,
|
126 |
-
# auth=(
|
127 |
# auth_message="Register at icon.is.tue.mpg.de to get HuggingFace username and password.")
|
128 |
|
129 |
demo.launch(debug=True, enable_queue=True)
|
|
|
14 |
'pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html'.split())
|
15 |
subprocess.run(
|
16 |
'pip install git+https://github.com/YuliangXiu/kaolin.git'.split())
|
|
|
17 |
subprocess.run('pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1110/download.html'.split())
|
18 |
subprocess.run(
|
19 |
'pip install git+https://github.com/Project-Splinter/human_det.git'.split())
|
|
|
72 |
|
73 |
random.seed(1993)
|
74 |
model_types = ['icon-filter', 'pifu', 'pamir']
|
75 |
+
examples = [[item, random.choice(model_types)] for item in random.sample(sorted(glob.glob('examples/*.png')), 4)]
|
76 |
|
77 |
with gr.Blocks() as demo:
|
78 |
gr.Markdown(description)
|
|
|
122 |
if __name__ == "__main__":
|
123 |
|
124 |
# demo.launch(debug=False, enable_queue=False,
|
125 |
+
# auth=(os.environ['USER'], os.environ['PASSWORD']),
|
126 |
# auth_message="Register at icon.is.tue.mpg.de to get HuggingFace username and password.")
|
127 |
|
128 |
demo.launch(debug=True, enable_queue=True)
|
apps/infer.py
CHANGED
@@ -454,6 +454,7 @@ def generate_model(in_path, model_type):
|
|
454 |
overlap_path = os.path.join(config_dict['out_dir'], cfg.name, f"png/{data['name']}_overlap.png")
|
455 |
|
456 |
torch.cuda.empty_cache()
|
|
|
457 |
del model
|
458 |
del dataset
|
459 |
del local_affine_model
|
|
|
454 |
overlap_path = os.path.join(config_dict['out_dir'], cfg.name, f"png/{data['name']}_overlap.png")
|
455 |
|
456 |
torch.cuda.empty_cache()
|
457 |
+
|
458 |
del model
|
459 |
del dataset
|
460 |
del local_affine_model
|
examples/923d65f767c85a42212cae13fba3750b.png
CHANGED
Git LFS Details
|
Git LFS Details
|
examples/959c4c726a69901ce71b93a9242ed900.png
CHANGED
Git LFS Details
|
Git LFS Details
|
lib/common/seg3d_lossless.py
CHANGED
@@ -584,7 +584,7 @@ class Seg3dLossless(nn.Module):
|
|
584 |
|
585 |
final = occupancys[1:, 1:, 1:].contiguous()
|
586 |
|
587 |
-
if final.shape[0]
|
588 |
# for voxelgrid larger than 256^3, the required GPU memory will be > 9GB
|
589 |
# thus we use CPU marching_cube to avoid "CUDA out of memory"
|
590 |
occu_arr = final.detach().cpu().numpy() # non-smooth surface
|
|
|
584 |
|
585 |
final = occupancys[1:, 1:, 1:].contiguous()
|
586 |
|
587 |
+
if final.shape[0] >= 256:
|
588 |
# for voxelgrid larger than 256^3, the required GPU memory will be > 9GB
|
589 |
# thus we use CPU marching_cube to avoid "CUDA out of memory"
|
590 |
occu_arr = final.detach().cpu().numpy() # non-smooth surface
|