MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / AppComponent

Class AppComponent

interactive-visualizers/src/app/app.component.ts:186–1181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184})
185
186export class AppComponent implements OnInit {
187 title = 'interactive-visualizers';
188
189 // Model related variables.
190 modelDisplayName: string = DEFAULT_MODEL_DISPLAY_NAME;
191 modelFormat: string|null = null; // Either 'tflite' or 'tfjs'.
192 tfWebApiName: string|null = null;
193 tfWebApi: any|null = null;
194 modelMetadataUrl: string|null = null;
195 modelMetadata: any|null = null;
196 model: tf.GraphModel|null = null;
197 labelmap: string[]|null = null;
198 defaultScoreThreshold = 0.0;
199 publisherName: string|null = null;
200 publisherThumbnailUrl: string|null = null;
201
202 // Query related variables.
203 queryImageHeight: number|null = null;
204 queryImageWidth: number|null = null;
205
206 // Test data related variables.
207 testImagesIndexUrl: string|null = null;
208 testImages: Array<{imageUrl: string, thumbnailUrl: string}> = [];
209 uploadedImages: string[] = [];
210 queryImageDataURL: string|null = null;
211 imageSelectedIndex: number|null = null;
212 isDraggedOver = false;
213
214 // Results variables.
215 resultsKeyName: string|null = null;
216 resultsValueName: string|null = null;
217 resultsLatency: number|null = null;
218 // Classifier specific variables.
219 classifierResults: Array<{displayName: string, score: number}>|null = null;
220 // Detector specific variables.
221 detectorResults: Array<{
222 id: number,
223 displayName: string,
224 box: number[],
225 score: number,
226 label: number
227 }>|null = null;
228 detectionLabels: Array<{
229 label: number,
230 displayName: string,
231 boxes: Array<{id: number, score: number}>,
232 color: string
233 }>|null = null;
234 detectionScoreThreshold = DEFAULT_DETECTION_THRESHOLD;
235 detectionLabelToIds = new Map();
236 collapsedDetectionLabels = new Set();
237 hoveredDetectionId: number|null = null;
238 hoveredDetectionLabel: number|null = null;
239 hoveredDetectionResultLabel: number|null = null;
240 hoveredDetectionResultId: number|null = null;
241 // Segmenter specific variables.
242 segmenterPredictions: number[][]|null = null;
243 segmenterLabelList: Array<{displayName: string, index: number,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected