Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,14 +25,14 @@ def run_theia(image, pred_iou_thresh, stability_score_thresh):
|
|
| 25 |
"LiheYoung/depth-anything-large-hf",
|
| 26 |
]
|
| 27 |
feature_means, feature_vars = load_feature_stats(target_model_names, stat_file_root="feature_stats")
|
| 28 |
-
|
| 29 |
mask_generator, sam_model = prepare_mask_generator('cuda')
|
| 30 |
depth_anything_model_name = "LiheYoung/depth-anything-large-hf"
|
| 31 |
depth_anything_decoder, _ = prepare_depth_decoder(depth_anything_model_name, 'cuda')
|
| 32 |
|
| 33 |
image = torchvision.transforms.Resize(size=(224, 224))(image)
|
| 34 |
images = [image]
|
| 35 |
-
|
| 36 |
theia_decode_results, gt_results = decode_everything(
|
| 37 |
theia_model=theia_model,
|
| 38 |
feature_means=feature_means,
|
|
@@ -70,10 +70,13 @@ with gr.Blocks() as demo:
|
|
| 70 |
with gr.Row():
|
| 71 |
with gr.Column():
|
| 72 |
input_image = gr.Image(label="Input Image", type="pil")
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
| 75 |
submit_button = gr.Button("Submit")
|
| 76 |
-
|
| 77 |
with gr.Column():
|
| 78 |
dinov2_output = gr.Gallery(label="DINOv2", type="numpy")
|
| 79 |
sam_output = gr.Gallery(label="SAM", type="numpy")
|
|
|
|
| 25 |
"LiheYoung/depth-anything-large-hf",
|
| 26 |
]
|
| 27 |
feature_means, feature_vars = load_feature_stats(target_model_names, stat_file_root="feature_stats")
|
| 28 |
+
|
| 29 |
mask_generator, sam_model = prepare_mask_generator('cuda')
|
| 30 |
depth_anything_model_name = "LiheYoung/depth-anything-large-hf"
|
| 31 |
depth_anything_decoder, _ = prepare_depth_decoder(depth_anything_model_name, 'cuda')
|
| 32 |
|
| 33 |
image = torchvision.transforms.Resize(size=(224, 224))(image)
|
| 34 |
images = [image]
|
| 35 |
+
|
| 36 |
theia_decode_results, gt_results = decode_everything(
|
| 37 |
theia_model=theia_model,
|
| 38 |
feature_means=feature_means,
|
|
|
|
| 70 |
with gr.Row():
|
| 71 |
with gr.Column():
|
| 72 |
input_image = gr.Image(label="Input Image", type="pil")
|
| 73 |
+
|
| 74 |
+
with gr.Accordion("Advanced Settings", open=False):
|
| 75 |
+
pred_iou_thresh = gr.Slider(0.05, 0.95, step=0.05, value=0.5, label="SAM Pred IoU Thresh")
|
| 76 |
+
stability_score_thresh = gr.Slider(0.05, 0.95, step=0.05, value=0.7, label="SAM Stability Score Thresh")
|
| 77 |
+
|
| 78 |
submit_button = gr.Button("Submit")
|
| 79 |
+
|
| 80 |
with gr.Column():
|
| 81 |
dinov2_output = gr.Gallery(label="DINOv2", type="numpy")
|
| 82 |
sam_output = gr.Gallery(label="SAM", type="numpy")
|