最終更新
役に立ちましたか?
役に立ちましたか?
{
"image": {"width": 640, "height": 480},
"predictions": [
{
"x": 320.0, "y": 240.0, "width": 200.0, "height": 180.0,
"confidence": 0.92,
"class_id": 1,
"class": "person",
"detection_id": "a1b2c3d4-...",
"rle_mask": {"size": [480, 640], "counts": "XYZ..."}
}
]
}import pycocotools.mask as mask_utils
import numpy as np
rle = prediction["rle_mask"]
binary_mask = mask_utils.decode(rle).astype(bool) # shape: (H, W)