(base: ModelArchitecture)
| 84 | * to labels. |
| 85 | */ |
| 86 | export 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` |
no outgoing calls
no test coverage detected