Segmentation Masks and Metadata
Celantur container can generate two different segmentation masks and metadata per processed image:
- Binary Segmentation
- Instance Segmentation
It's activated with the
--save-mask {all, instance, binary}
parameter. The segmentation is saved as a PNG file.
Anonymization, binary segmentation and instance segmentation applied to an image with Celantur software.
The binary segmentation mask consist of two colors:
- Background is black
- Anonymized segments are white
The file will be saved as
image-name_bin_mask.png
.The instance segmentation mask consists of multiple colors. The RGB color values are used to differentiate to individual instances/objects.
- The R (red) channel encodes the object type:
- License plate:
64
- Person:
128
- Face:
192
- Vehicle:
255
- The G (green) channel encodes individual instances/objects.
- The B (blue) channel is 0.
E.g.
[192, 85, 0]
is a face.The file will be saved as
image-name_ins_maks.png
.By adding the optional
--mask-scale {0-100}
(CLI) or /v1/file/1/instance-mask?mask-scale={0-100}
(Container API) parameter, mask files will be scaled down by the specified ratio.Metadata about detected instances/objects are stored in the corresponding
image-name.json
file.Detected instances/objects provided as a list under the
detections
attribute:Attribute | Description |
---|---|
id | The id of the detection |
parent_image | The name of the image the detected instance/object was found on |
offset | The offset of the detection's bounding box from the upper left corner of the image (x/y coordinates in pixels) |
bbox | The coordinates of the detection's bounding box (x1, y1, x2, y2) |
score | The detection's confidence score. States how confident the model is about the detection being a specific label (see type_label) between 0.0 and 1.0. |
is_anonymized | Specifies whether the detection was anonymized. |
type_label | The detection's label assigned by the model. E.g. face, license plates, etc. |
color | The detections color (RGB) in the instance segmentation mask. |
{
"id": "image-name.jpg",
"detections": [
{
"id": 0,
"parent_image": "image-name.jpg",
"offset": [1586, 776],
"bbox": [1586, 776, 3094, 3453],
"type": 102,
"score": 0.9994864463806152,
"is_anonymised": true,
"type_label": "person",
"color": [128, 85, 0]
},
{
"id": 0,
"parent_image": "image-name.jpg",
"offset": [3691, 674],
"bbox": [3691, 674, 5180, 3431],
"type": 102,
"score": 0.9987647533416748,
"is_anonymised": true,
"type_label": "person",
"color": [128, 170, 0]
},
...
Last modified 4mo ago