Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
ad2fde6
1
Parent(s):
7d8772d
docs: little update
Browse files
app.py
CHANGED
|
@@ -116,7 +116,7 @@ train_transforms = transforms.Compose(
|
|
| 116 |
|
| 117 |
|
| 118 |
# Download to avoid uneasy git lfs install
|
| 119 |
-
os.system("wget https://github.com/user-attachments/files/23571020/assets.zip")
|
| 120 |
os.system("unzip assets.zip")
|
| 121 |
|
| 122 |
|
|
@@ -179,7 +179,7 @@ pipe.enable_model_cpu_offload()
|
|
| 179 |
model_type = "vit_h" #vit-h has the most number of paramter
|
| 180 |
sam_pretrained_path = "pretrained/sam_vit_h_4b8939.pth"
|
| 181 |
if not os.path.exists(sam_pretrained_path):
|
| 182 |
-
os.system("wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -P pretrained/")
|
| 183 |
sam = sam_model_registry[model_type](checkpoint = sam_pretrained_path).to(device="cuda")
|
| 184 |
sam_predictor = SamPredictor(sam) # There is a lot of setting here
|
| 185 |
|
|
@@ -512,7 +512,7 @@ def sample_traj_by_length(points, num_samples):
|
|
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
-
@spaces.GPU(duration=
|
| 516 |
def inference(inference_canvas, visual_canvas, text_prompt, traj_lists, main_reference_img,
|
| 517 |
resized_height, resized_width, top_left_height, top_left_width, bottom_right_height, bottom_right_width):
|
| 518 |
|
|
@@ -607,6 +607,7 @@ def inference(inference_canvas, visual_canvas, text_prompt, traj_lists, main_ref
|
|
| 607 |
|
| 608 |
|
| 609 |
# Create the traj tensor
|
|
|
|
| 610 |
traj_tensor, traj_imgs_np, _, img_with_traj = VideoDataset_Motion.prepare_traj_tensor(
|
| 611 |
full_pred_tracks, canvas_height, canvas_width,
|
| 612 |
[], dot_radius, canvas_width, canvas_height,
|
|
|
|
| 116 |
|
| 117 |
|
| 118 |
# Download to avoid uneasy git lfs install
|
| 119 |
+
os.system("wget -q https://github.com/user-attachments/files/23571020/assets.zip")
|
| 120 |
os.system("unzip assets.zip")
|
| 121 |
|
| 122 |
|
|
|
|
| 179 |
model_type = "vit_h" #vit-h has the most number of paramter
|
| 180 |
sam_pretrained_path = "pretrained/sam_vit_h_4b8939.pth"
|
| 181 |
if not os.path.exists(sam_pretrained_path):
|
| 182 |
+
os.system("wget -q https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -P pretrained/")
|
| 183 |
sam = sam_model_registry[model_type](checkpoint = sam_pretrained_path).to(device="cuda")
|
| 184 |
sam_predictor = SamPredictor(sam) # There is a lot of setting here
|
| 185 |
|
|
|
|
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
+
@spaces.GPU(duration=200)
|
| 516 |
def inference(inference_canvas, visual_canvas, text_prompt, traj_lists, main_reference_img,
|
| 517 |
resized_height, resized_width, top_left_height, top_left_width, bottom_right_height, bottom_right_width):
|
| 518 |
|
|
|
|
| 607 |
|
| 608 |
|
| 609 |
# Create the traj tensor
|
| 610 |
+
print("inference_canvas is", inference_canvas)
|
| 611 |
traj_tensor, traj_imgs_np, _, img_with_traj = VideoDataset_Motion.prepare_traj_tensor(
|
| 612 |
full_pred_tracks, canvas_height, canvas_width,
|
| 613 |
[], dot_radius, canvas_width, canvas_height,
|