Spaces:
Sleeping
Sleeping
kyleleey
commited on
Commit
•
faa1e2c
1
Parent(s):
e2db5d0
update
Browse files
app.py
CHANGED
@@ -4,9 +4,21 @@ import gradio as gr
|
|
4 |
from PIL import Image
|
5 |
from functools import partial
|
6 |
import argparse
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
import cv2
|
12 |
import time
|
@@ -16,7 +28,6 @@ from segment_anything import sam_model_registry, SamPredictor
|
|
16 |
|
17 |
import random
|
18 |
from pytorch3d import transforms
|
19 |
-
import torch
|
20 |
import torchvision
|
21 |
import torch.distributed as dist
|
22 |
import nvdiffrast.torch as dr
|
|
|
4 |
from PIL import Image
|
5 |
from functools import partial
|
6 |
import argparse
|
7 |
+
import sys
|
8 |
+
import torch
|
9 |
+
|
10 |
+
if os.getenv('SYSTEM') == 'spaces':
|
11 |
+
os.system('pip install --global-option="--no-networks" git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch')
|
12 |
|
13 |
+
pyt_version_str=torch.__version__.split("+")[0].replace(".", "")
|
14 |
+
version_str="".join([
|
15 |
+
f"py3{sys.version_info.minor}_cu",
|
16 |
+
torch.version.cuda.replace(".",""),
|
17 |
+
f"_pyt{pyt_version_str}"
|
18 |
+
])
|
19 |
+
os.system('pip install fvcore iopath')
|
20 |
+
os.system(f'pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html')
|
21 |
+
# os.system('pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"')
|
22 |
|
23 |
import cv2
|
24 |
import time
|
|
|
28 |
|
29 |
import random
|
30 |
from pytorch3d import transforms
|
|
|
31 |
import torchvision
|
32 |
import torch.distributed as dist
|
33 |
import nvdiffrast.torch as dr
|