json2labels

tomni.transformers.json2labels(json_list: List[dict], output_dim: tuple) numpy.ndarray[source]

Convert a list of JSON objects representing objects to a labeled segmentation map.

Parameters
  • json_list (list of dict) – A list of objects in JSON format, each describing an object to be labeled.

  • output_dim (tuple of int) – The dimensions of the output image in image coordinates, specified as (width, height).

Returns

A segmentation map where each object has a unique label.

Return type

np.ndarray

Raises

ValueError – If an unsupported object type is encountered in the JSON list.