Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ def run_theia(image):
|
|
33 |
image = torchvision.transforms.Resize(size=(224, 224))(image)
|
34 |
images = [image]
|
35 |
|
36 |
-
theia_decode_results,
|
37 |
theia_model=theia_model,
|
38 |
feature_means=feature_means,
|
39 |
feature_vars=feature_vars,
|
@@ -51,9 +51,9 @@ def run_theia(image):
|
|
51 |
theia_decode_dino = (255.0 * theia_decode_results[0]).astype(np.uint8)[:, width // 4 : 2 * width // 4, :]
|
52 |
theia_decode_sam = (255.0 * theia_decode_results[0]).astype(np.uint8)[:, 2 * width // 4 : 3 * width // 4, :]
|
53 |
theia_decode_depth = (255.0 * theia_decode_results[0]).astype(np.uint8)[:, 3 * width // 4 :, :]
|
54 |
-
gt_dino = (255.0 *
|
55 |
-
gt_sam = (255.0 *
|
56 |
-
gt_depth = (255.0 *
|
57 |
|
58 |
theia_output = [(theia_decode_dino, "DINOv2"), (theia_decode_sam, "SAM"), (theia_decode_depth, "Depth-Anything")]
|
59 |
gt_output = [(gt_dino, "DINOv2"), (gt_sam, "SAM"), (gt_depth, "Depth-Anything")]
|
|
|
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,
|
39 |
feature_vars=feature_vars,
|
|
|
51 |
theia_decode_dino = (255.0 * theia_decode_results[0]).astype(np.uint8)[:, width // 4 : 2 * width // 4, :]
|
52 |
theia_decode_sam = (255.0 * theia_decode_results[0]).astype(np.uint8)[:, 2 * width // 4 : 3 * width // 4, :]
|
53 |
theia_decode_depth = (255.0 * theia_decode_results[0]).astype(np.uint8)[:, 3 * width // 4 :, :]
|
54 |
+
gt_dino = (255.0 * gt_results[0]).astype(np.uint8)[:, width // 4 : 2 * width // 4, :]
|
55 |
+
gt_sam = (255.0 * gt_results[0]).astype(np.uint8)[:, 2 * width // 4 : 3 * width // 4, :]
|
56 |
+
gt_depth = (255.0 * gt_results[0]).astype(np.uint8)[:, 3 * width // 4 :, :]
|
57 |
|
58 |
theia_output = [(theia_decode_dino, "DINOv2"), (theia_decode_sam, "SAM"), (theia_decode_depth, "Depth-Anything")]
|
59 |
gt_output = [(gt_dino, "DINOv2"), (gt_sam, "SAM"), (gt_depth, "Depth-Anything")]
|