Spaces:
Build error
Build error
oneScotch
commited on
Commit
·
1fbff1e
1
Parent(s):
c034d58
switch to zero gpu
Browse files
app.py
CHANGED
@@ -17,18 +17,27 @@ os.system('cp -rf /home/user/app/assets/conversions.py /home/user/.local/lib/pyt
|
|
17 |
DEFAULT_MODEL='smpler_x_h32'
|
18 |
OUT_FOLDER = '/home/user/app/demo_out'
|
19 |
os.makedirs(OUT_FOLDER, exist_ok=True)
|
20 |
-
num_gpus = 1 if torch.cuda.is_available() else -1
|
21 |
# print("!!!", torch.cuda.is_available())
|
22 |
# print(torch.cuda.device_count())
|
23 |
# print(torch.version.cuda)
|
24 |
# index = torch.cuda.current_device()
|
25 |
# print(index)
|
26 |
# print(torch.cuda.get_device_name(index))
|
27 |
-
from main.inference import Inferer
|
28 |
-
inferer = Inferer(DEFAULT_MODEL, num_gpus, OUT_FOLDER)
|
29 |
|
30 |
@spaces.GPU(enable_queue=True)
|
31 |
def infer(video_input, in_threshold=0.5, num_people="Single person", render_mesh=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
os.system(f'rm -rf {OUT_FOLDER}/*')
|
33 |
multi_person = False if (num_people == "Single person") else True
|
34 |
cap = cv2.VideoCapture(video_input)
|
|
|
17 |
DEFAULT_MODEL='smpler_x_h32'
|
18 |
OUT_FOLDER = '/home/user/app/demo_out'
|
19 |
os.makedirs(OUT_FOLDER, exist_ok=True)
|
20 |
+
# num_gpus = 1 if torch.cuda.is_available() else -1
|
21 |
# print("!!!", torch.cuda.is_available())
|
22 |
# print(torch.cuda.device_count())
|
23 |
# print(torch.version.cuda)
|
24 |
# index = torch.cuda.current_device()
|
25 |
# print(index)
|
26 |
# print(torch.cuda.get_device_name(index))
|
27 |
+
# from main.inference import Inferer
|
28 |
+
# inferer = Inferer(DEFAULT_MODEL, num_gpus, OUT_FOLDER)
|
29 |
|
30 |
@spaces.GPU(enable_queue=True)
|
31 |
def infer(video_input, in_threshold=0.5, num_people="Single person", render_mesh=False):
|
32 |
+
num_gpus = 1 if torch.cuda.is_available() else -1
|
33 |
+
print("!!!", torch.cuda.is_available())
|
34 |
+
print(torch.cuda.device_count())
|
35 |
+
print(torch.version.cuda)
|
36 |
+
index = torch.cuda.current_device()
|
37 |
+
print(index)
|
38 |
+
print(torch.cuda.get_device_name(index))
|
39 |
+
from main.inference import Inferer
|
40 |
+
inferer = Inferer(DEFAULT_MODEL, num_gpus, OUT_FOLDER)
|
41 |
os.system(f'rm -rf {OUT_FOLDER}/*')
|
42 |
multi_person = False if (num_people == "Single person") else True
|
43 |
cap = cv2.VideoCapture(video_input)
|