test
Browse files
app.py
CHANGED
@@ -925,10 +925,6 @@ class DynamicsVisualizer:
|
|
925 |
|
926 |
@spaces.GPU
|
927 |
def reset(self):
|
928 |
-
# import torch
|
929 |
-
# import torch.nn as nn
|
930 |
-
# from torch.utils.data import DataLoader
|
931 |
-
# import kornia
|
932 |
import warp as wp
|
933 |
|
934 |
device = torch.device('cuda:0')
|
@@ -977,7 +973,7 @@ class DynamicsVisualizer:
|
|
977 |
|
978 |
form_video = gr.Video(
|
979 |
label='Predicted video',
|
980 |
-
value=root / f'log/gs/temp/
|
981 |
format='mp4',
|
982 |
width=self.width,
|
983 |
height=self.height,
|
@@ -992,7 +988,15 @@ class DynamicsVisualizer:
|
|
992 |
return form_video, form_3dgs_pred
|
993 |
|
994 |
def run_command(self, unit_command):
|
995 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
996 |
os.system('rm -rf ' + str(root / 'log/temp/*'))
|
997 |
|
998 |
# im_list = []
|
@@ -1079,68 +1083,26 @@ class DynamicsVisualizer:
|
|
1079 |
|
1080 |
@spaces.GPU
|
1081 |
def on_click_run_xplus(self):
|
1082 |
-
gpus = [int(gpu) for gpu in self.cfg.gpus]
|
1083 |
-
wp_devices = [wp.get_device(f'cuda:{gpu}') for gpu in gpus]
|
1084 |
-
torch_devices = [torch.device(f'cuda:{gpu}') for gpu in gpus]
|
1085 |
-
device_count = len(torch_devices)
|
1086 |
-
assert device_count == 1
|
1087 |
-
self.wp_device = wp_devices[0]
|
1088 |
-
self.torch_device = torch_devices[0]
|
1089 |
return self.run_command([5.0, 0, 0])
|
1090 |
|
1091 |
@spaces.GPU
|
1092 |
def on_click_run_xminus(self):
|
1093 |
-
gpus = [int(gpu) for gpu in self.cfg.gpus]
|
1094 |
-
wp_devices = [wp.get_device(f'cuda:{gpu}') for gpu in gpus]
|
1095 |
-
torch_devices = [torch.device(f'cuda:{gpu}') for gpu in gpus]
|
1096 |
-
device_count = len(torch_devices)
|
1097 |
-
assert device_count == 1
|
1098 |
-
self.wp_device = wp_devices[0]
|
1099 |
-
self.torch_device = torch_devices[0]
|
1100 |
return self.run_command([-5.0, 0, 0])
|
1101 |
|
1102 |
@spaces.GPU
|
1103 |
def on_click_run_yplus(self):
|
1104 |
-
gpus = [int(gpu) for gpu in self.cfg.gpus]
|
1105 |
-
wp_devices = [wp.get_device(f'cuda:{gpu}') for gpu in gpus]
|
1106 |
-
torch_devices = [torch.device(f'cuda:{gpu}') for gpu in gpus]
|
1107 |
-
device_count = len(torch_devices)
|
1108 |
-
assert device_count == 1
|
1109 |
-
self.wp_device = wp_devices[0]
|
1110 |
-
self.torch_device = torch_devices[0]
|
1111 |
return self.run_command([0, 5.0, 0])
|
1112 |
|
1113 |
@spaces.GPU
|
1114 |
def on_click_run_yminus(self):
|
1115 |
-
gpus = [int(gpu) for gpu in self.cfg.gpus]
|
1116 |
-
wp_devices = [wp.get_device(f'cuda:{gpu}') for gpu in gpus]
|
1117 |
-
torch_devices = [torch.device(f'cuda:{gpu}') for gpu in gpus]
|
1118 |
-
device_count = len(torch_devices)
|
1119 |
-
assert device_count == 1
|
1120 |
-
self.wp_device = wp_devices[0]
|
1121 |
-
self.torch_device = torch_devices[0]
|
1122 |
return self.run_command([0, -5.0, 0])
|
1123 |
|
1124 |
@spaces.GPU
|
1125 |
def on_click_run_zplus(self):
|
1126 |
-
gpus = [int(gpu) for gpu in self.cfg.gpus]
|
1127 |
-
wp_devices = [wp.get_device(f'cuda:{gpu}') for gpu in gpus]
|
1128 |
-
torch_devices = [torch.device(f'cuda:{gpu}') for gpu in gpus]
|
1129 |
-
device_count = len(torch_devices)
|
1130 |
-
assert device_count == 1
|
1131 |
-
self.wp_device = wp_devices[0]
|
1132 |
-
self.torch_device = torch_devices[0]
|
1133 |
return self.run_command([0, 0, 5.0])
|
1134 |
|
1135 |
@spaces.GPU
|
1136 |
def on_click_run_zminus(self):
|
1137 |
-
gpus = [int(gpu) for gpu in self.cfg.gpus]
|
1138 |
-
wp_devices = [wp.get_device(f'cuda:{gpu}') for gpu in gpus]
|
1139 |
-
torch_devices = [torch.device(f'cuda:{gpu}') for gpu in gpus]
|
1140 |
-
device_count = len(torch_devices)
|
1141 |
-
assert device_count == 1
|
1142 |
-
self.wp_device = wp_devices[0]
|
1143 |
-
self.torch_device = torch_devices[0]
|
1144 |
return self.run_command([0, 0, -5.0])
|
1145 |
|
1146 |
def launch(self, share=False):
|
|
|
925 |
|
926 |
@spaces.GPU
|
927 |
def reset(self):
|
|
|
|
|
|
|
|
|
928 |
import warp as wp
|
929 |
|
930 |
device = torch.device('cuda:0')
|
|
|
973 |
|
974 |
form_video = gr.Video(
|
975 |
label='Predicted video',
|
976 |
+
value=root / f'log/gs/temp/form_video_init.mp4',
|
977 |
format='mp4',
|
978 |
width=self.width,
|
979 |
height=self.height,
|
|
|
988 |
return form_video, form_3dgs_pred
|
989 |
|
990 |
def run_command(self, unit_command):
|
991 |
+
import warp as wp
|
992 |
+
wp.init()
|
993 |
+
gpus = [int(gpu) for gpu in self.cfg.gpus]
|
994 |
+
wp_devices = [wp.get_device(f'cuda:{gpu}') for gpu in gpus]
|
995 |
+
torch_devices = [torch.device(f'cuda:{gpu}') for gpu in gpus]
|
996 |
+
device_count = len(torch_devices)
|
997 |
+
assert device_count == 1
|
998 |
+
self.wp_device = wp_devices[0]
|
999 |
+
self.torch_device = torch_devices[0]
|
1000 |
os.system('rm -rf ' + str(root / 'log/temp/*'))
|
1001 |
|
1002 |
# im_list = []
|
|
|
1083 |
|
1084 |
@spaces.GPU
|
1085 |
def on_click_run_xplus(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1086 |
return self.run_command([5.0, 0, 0])
|
1087 |
|
1088 |
@spaces.GPU
|
1089 |
def on_click_run_xminus(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1090 |
return self.run_command([-5.0, 0, 0])
|
1091 |
|
1092 |
@spaces.GPU
|
1093 |
def on_click_run_yplus(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1094 |
return self.run_command([0, 5.0, 0])
|
1095 |
|
1096 |
@spaces.GPU
|
1097 |
def on_click_run_yminus(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1098 |
return self.run_command([0, -5.0, 0])
|
1099 |
|
1100 |
@spaces.GPU
|
1101 |
def on_click_run_zplus(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1102 |
return self.run_command([0, 0, 5.0])
|
1103 |
|
1104 |
@spaces.GPU
|
1105 |
def on_click_run_zminus(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1106 |
return self.run_command([0, 0, -5.0])
|
1107 |
|
1108 |
def launch(self, share=False):
|