MCPcopy
hub / github.com/tensorflow/tfjs-models / getColormap

Function getColormap

deeplab/src/utils.ts:86–98  ·  view source on GitHub ↗
(base: ModelArchitecture)

Source from the content-addressed store, hash-verified

84 * to labels.
85 */
86export function getColormap(base: ModelArchitecture): Color[] {
87 if (base === 'pascal') {
88 return config['COLORMAPS']['PASCAL'] as Color[];
89 } else if (base === 'ade20k') {
90 return config['COLORMAPS']['ADE20K'] as Color[];
91 } else if (base === 'cityscapes') {
92 return config['COLORMAPS']['CITYSCAPES'] as Color[];
93 }
94 throw new Error(
95 `SemanticSegmentation cannot be constructed ` +
96 `with an invalid base model ${base}. ` +
97 `Try one of 'pascal', 'cityscapes' and 'ade20k'.`);
98}
99
100/**
101 * @param base :: `ModelArchitecture`

Callers 2

segmentMethod · 0.90
utils_test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected