John Ho
commited on
Commit
·
603e63e
1
Parent(s):
59822ae
updated to return b64 mask decoded into string
Browse files- samv2_handler.py +2 -2
samv2_handler.py
CHANGED
|
@@ -145,7 +145,7 @@ def run_sam_im_inference(
|
|
| 145 |
else:
|
| 146 |
output_masks.append(mask.squeeze().astype(np.uint8))
|
| 147 |
return (
|
| 148 |
-
[b64_mask_encode(m) for m in output_masks]
|
| 149 |
if b64_encode_mask
|
| 150 |
else output_masks
|
| 151 |
)
|
|
@@ -207,7 +207,7 @@ def run_sam_video_inference(
|
|
| 207 |
"conf": 1,
|
| 208 |
}
|
| 209 |
if not drop_mask:
|
| 210 |
-
det["mask_b64"] = b64_mask_encode(mask)
|
| 211 |
detections.append(det)
|
| 212 |
|
| 213 |
if do_tidy_up:
|
|
|
|
| 145 |
else:
|
| 146 |
output_masks.append(mask.squeeze().astype(np.uint8))
|
| 147 |
return (
|
| 148 |
+
[b64_mask_encode(m).decode("ascii") for m in output_masks]
|
| 149 |
if b64_encode_mask
|
| 150 |
else output_masks
|
| 151 |
)
|
|
|
|
| 207 |
"conf": 1,
|
| 208 |
}
|
| 209 |
if not drop_mask:
|
| 210 |
+
det["mask_b64"] = b64_mask_encode(mask).decode("ascii")
|
| 211 |
detections.append(det)
|
| 212 |
|
| 213 |
if do_tidy_up:
|