gpu usage
Browse files
app.py
CHANGED
|
@@ -41,8 +41,18 @@ def cmd(command):
|
|
| 41 |
print(command)
|
| 42 |
subprocess.run(shlex.split(command))
|
| 43 |
|
| 44 |
-
@spaces.GPU
|
| 45 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
print('gpu:', command)
|
| 47 |
subprocess.run(shlex.split(command))
|
| 48 |
|
|
@@ -65,18 +75,18 @@ def process(inputfiles, input_path='demo'):
|
|
| 65 |
|
| 66 |
imgs_path = temp_dir
|
| 67 |
output_path = f'./results/{input_path}/output'
|
| 68 |
-
|
| 69 |
--pretrained=Kai422kx/das3r \
|
| 70 |
--dir_path={imgs_path} \
|
| 71 |
--output_dir={output_path} \
|
| 72 |
-
--use_pred_mask ")
|
| 73 |
|
| 74 |
cmd(f"python utils/rearrange.py --output_dir={output_path}")
|
| 75 |
output_path = f'{output_path}_rearranged'
|
| 76 |
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
|
| 81 |
|
| 82 |
output_video_path = f"{output_path}/rendered.mp4"
|
|
|
|
| 41 |
print(command)
|
| 42 |
subprocess.run(shlex.split(command))
|
| 43 |
|
| 44 |
+
@spaces.GPU(duration=70)
|
| 45 |
+
def cmd_gpu_s1(command):
|
| 46 |
+
print('gpu:', command)
|
| 47 |
+
subprocess.run(shlex.split(command))
|
| 48 |
+
|
| 49 |
+
@spaces.GPU(duration=40)
|
| 50 |
+
def cmd_gpu_s2(command):
|
| 51 |
+
print('gpu:', command)
|
| 52 |
+
subprocess.run(shlex.split(command))
|
| 53 |
+
|
| 54 |
+
@spaces.GPU(duration=20)
|
| 55 |
+
def cmd_gpu_s3(command):
|
| 56 |
print('gpu:', command)
|
| 57 |
subprocess.run(shlex.split(command))
|
| 58 |
|
|
|
|
| 75 |
|
| 76 |
imgs_path = temp_dir
|
| 77 |
output_path = f'./results/{input_path}/output'
|
| 78 |
+
cmd_gpu_s1(f"python dynamic_predictor/launch.py --mode=eval_pose_custom \
|
| 79 |
--pretrained=Kai422kx/das3r \
|
| 80 |
--dir_path={imgs_path} \
|
| 81 |
--output_dir={output_path} \
|
| 82 |
+
--use_pred_mask --n_iter 150")
|
| 83 |
|
| 84 |
cmd(f"python utils/rearrange.py --output_dir={output_path}")
|
| 85 |
output_path = f'{output_path}_rearranged'
|
| 86 |
|
| 87 |
|
| 88 |
+
cmd_gpu_s2(f"python train_gui.py -s {output_path} -m {output_path} --iter 2000")
|
| 89 |
+
cmd_gpu_s3(f"python render.py -s {output_path} -m {output_path} --iter 2000 --get_video")
|
| 90 |
|
| 91 |
|
| 92 |
output_video_path = f"{output_path}/rendered.mp4"
|