misc#

Functions

all_equal(it)

Returns true if all elements are equal to each other

color_to_integer(color)

Given a PIL ImageColor string, return a packed integer.

color_to_triple([color])

Given a PIL ImageColor string, return a triple of integers representing the red, green, and blue values.

ensure_json_serializable(obj)

Convert numpy types to JSON serializable equivalents.

listify_uris(uris)

Convert to URI to list if needed.

match_bboxes(raster_source, label_source)

Set label_souce bbox equal to raster_source bbox.

normalize_color(color)

Convert color representation to a float 3-tuple with values in [0-1].

parse_array_slices_2d(key, extent)

Parse 2D array-indexing inputs into a Box and slices.

parse_array_slices_Nd(key, extent[, dims, ...])

Parse multi-dim array-indexing inputs into a Box and slices.

rgb_to_int_array(rgb_array)

save_img(im_array, output_path)

Save numpy array as image file.