Replies: 1 comment 1 reply
-
|
How about sc:GeoShape instead of The subField approach seems overly complicated... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Introduction
In computer vision, segmentation is the ML task to recognize objects in an image at the pixel level. The annotations are "segmentation masks", i.e. segments or the zones of interest in the image. Segmentation is a wide-spread enough task in ML for segmentation masks to deserve a first-class place in Croissant JSON-LD definition.
Here is a good example by fchollet@.
Usual format for segmentation masks:
Examples
Example 1: YOLO
YOLO declares *.txt files where each line is:
where
x_iandy_iare the (x, y) coordinates in percentage.Example 2: COCO
COCO uses two different formats:
Croissant standard proposal
We saw that we need to support segmentation masks as both list of coordinates and images.
We could define the following types:
ml:SegmentationMaskfor the image representation of segmentation masks.ml:Polygonfor the polygon representation of segmentation masks.ml:Polygoncan be later re-used for other tasks. Another proposition is to re-use the existingsc:GeoCoordinates.Segmentation masks as images
For the image representation, we can already define an image in a field:
{ "@type": "ml:Field", "name": "segmentation_mask", "description": "The segmentation mask as a PNG.", "dataType": ["sc:ImageObject", "ml:SegmentationMask"], "source": { "dataExtraction": { "fileProperty": "content" }, "distribution": "images" } },Segmentation masks as polygons
For the polygon representation, we propose to define SubFields:
{ "@type": "ml:Field", "name": "segmentation_mask", "description": "The segmentation mask as a polygon.", "dataType": ["ml:RecordSet", "ml:Polygon"], "subField": [ { "@type": "ml:Field", "name": "x", "source": { "applyTransform": [ { "separator": " " }, { "jsonPath": "$.[1::2]" } ], "dataExtraction": { "fileProperty": "line" }, "distribution": "annotations" } }, { "@type": "ml:Field", "name": "y", "source": { "applyTransform": [ { "separator": " " }, { "jsonPath": "$.[2::2]" } ], "dataExtraction": { "fileProperty": "line" }, "distribution": "annotations" } } ] }The problem here is the data extraction method. So we use the
sourceto:"fileProperty": "line")."separator": " ")."jsonPath": "$.[1::2]").Beta Was this translation helpful? Give feedback.
All reactions