Spaces:
Sleeping
Sleeping
Commit
·
6985ac5
1
Parent(s):
d823b65
app.py
CHANGED
|
@@ -247,6 +247,7 @@ def process_video(
|
|
| 247 |
window_size,
|
| 248 |
overlap
|
| 249 |
):
|
|
|
|
| 250 |
try:
|
| 251 |
pipe = get_model(model_size)
|
| 252 |
if pipe is None:
|
|
@@ -645,8 +646,7 @@ with gr.Blocks(css=css, title="DKT", head=head_html) as demo:
|
|
| 645 |
input_video, model_size, num_inference_steps, overlap
|
| 646 |
],
|
| 647 |
outputs=[
|
| 648 |
-
output_video, vis_video,
|
| 649 |
-
output_point_map0, output_point_map1, output_point_map2, output_point_map3
|
| 650 |
]
|
| 651 |
)
|
| 652 |
|
|
@@ -654,6 +654,8 @@ with gr.Blocks(css=css, title="DKT", head=head_html) as demo:
|
|
| 654 |
|
| 655 |
example_files = glob.glob('examples/*')
|
| 656 |
logger.info(f'there are {len(example_files)} demo files')
|
|
|
|
|
|
|
| 657 |
if example_files:
|
| 658 |
example_inputs = []
|
| 659 |
for file_path in example_files:
|
|
@@ -676,9 +678,12 @@ if __name__ == '__main__':
|
|
| 676 |
#* main code, model and moge model initialization
|
| 677 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 678 |
logger.info(f"device = {device}")
|
|
|
|
|
|
|
| 679 |
load_model_1_3b(device=device)
|
| 680 |
load_moge_model(device=device)
|
| 681 |
torch.cuda.empty_cache()
|
|
|
|
| 682 |
|
| 683 |
demo.queue().launch(share = False,server_name="0.0.0.0", server_port=7860)
|
| 684 |
|
|
|
|
| 247 |
window_size,
|
| 248 |
overlap
|
| 249 |
):
|
| 250 |
+
print('process_video called')
|
| 251 |
try:
|
| 252 |
pipe = get_model(model_size)
|
| 253 |
if pipe is None:
|
|
|
|
| 646 |
input_video, model_size, num_inference_steps, overlap
|
| 647 |
],
|
| 648 |
outputs=[
|
| 649 |
+
output_video, vis_video, output_point_map0, output_point_map1, output_point_map2, output_point_map3
|
|
|
|
| 650 |
]
|
| 651 |
)
|
| 652 |
|
|
|
|
| 654 |
|
| 655 |
example_files = glob.glob('examples/*')
|
| 656 |
logger.info(f'there are {len(example_files)} demo files')
|
| 657 |
+
print(f'there are {len(example_files)} demo files')
|
| 658 |
+
|
| 659 |
if example_files:
|
| 660 |
example_inputs = []
|
| 661 |
for file_path in example_files:
|
|
|
|
| 678 |
#* main code, model and moge model initialization
|
| 679 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 680 |
logger.info(f"device = {device}")
|
| 681 |
+
print(f"device = {device}")
|
| 682 |
+
|
| 683 |
load_model_1_3b(device=device)
|
| 684 |
load_moge_model(device=device)
|
| 685 |
torch.cuda.empty_cache()
|
| 686 |
+
print('model init done!')
|
| 687 |
|
| 688 |
demo.queue().launch(share = False,server_name="0.0.0.0", server_port=7860)
|
| 689 |
|