Spaces:
Runtime error
Runtime error
fix bugs
Browse files
app.py
CHANGED
@@ -22,11 +22,11 @@ hourglass_args = {
|
|
22 |
},
|
23 |
}
|
24 |
|
25 |
-
def predict(image, speed_mode,
|
26 |
mask_generator = SamAutomaticMaskGenerator(
|
27 |
build_sam(checkpoint="sam_vit_h_4b8939.pth", hourglass_kwargs=hourglass_args[speed_mode]),
|
28 |
-
|
29 |
-
points_per_batch=64 if
|
30 |
)
|
31 |
masks = mask_generator.generate(image)
|
32 |
|
|
|
22 |
},
|
23 |
}
|
24 |
|
25 |
+
def predict(image, speed_mode, points_per_side):
|
26 |
mask_generator = SamAutomaticMaskGenerator(
|
27 |
build_sam(checkpoint="sam_vit_h_4b8939.pth", hourglass_kwargs=hourglass_args[speed_mode]),
|
28 |
+
points_per_side=points_per_side,
|
29 |
+
points_per_batch=64 if points_per_side > 12 else points_per_side * points_per_side
|
30 |
)
|
31 |
masks = mask_generator.generate(image)
|
32 |
|