@tensorflow-models/coco-ssd
Version:
Object detection model (coco-ssd) in TensorFlow.js
80 lines (79 loc) • 3.28 kB
TypeScript
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
export interface Features {
'DEBUG'?: boolean;
'IS_BROWSER'?: boolean;
'IS_NODE'?: boolean;
'WEBGL_LAZILY_UNPACK'?: boolean;
'WEBGL_CPU_FORWARD'?: boolean;
'WEBGL_PACK'?: boolean;
'WEBGL_PACK_BATCHNORMALIZATION'?: boolean;
'WEBGL_PACK_CLIP'?: boolean;
'WEBGL_PACK_DEPTHWISECONV'?: boolean;
'WEBGL_PACK_BINARY_OPERATIONS'?: boolean;
'WEBGL_PACK_ARRAY_OPERATIONS'?: boolean;
'WEBGL_PACK_IMAGE_OPERATIONS'?: boolean;
'WEBGL_CONV_IM2COL'?: boolean;
'WEBGL_MAX_TEXTURE_SIZE'?: number;
'WEBGL_MAX_TEXTURES_IN_SHADER'?: number;
'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'?: number;
'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE'?: boolean;
'WEBGL_VERSION'?: number;
'HAS_WEBGL'?: boolean;
'WEBGL_RENDER_FLOAT32_ENABLED'?: boolean;
'WEBGL_DOWNLOAD_FLOAT_ENABLED'?: boolean;
'WEBGL_FENCE_API_ENABLED'?: boolean;
'WEBGL_SIZE_UPLOAD_UNIFORM'?: number;
/**
* Number of megabytes bytes allocated on the GPU before we start moving data
* to cpu. Moving avoids gpu memory leaks and relies on JS's garbage
* collector.
*/
'WEBGL_NUM_MB_BEFORE_PAGING'?: number;
'BACKEND'?: string;
'TEST_EPSILON'?: number;
'IS_CHROME'?: boolean;
'IS_TEST'?: boolean;
'EPSILON'?: number;
'PROD'?: boolean;
'TENSORLIKE_CHECK_SHAPE_CONSISTENCY'?: boolean;
'DEPRECATION_WARNINGS_ENABLED'?: boolean;
}
export declare enum Type {
NUMBER = 0,
BOOLEAN = 1,
STRING = 2
}
export declare const URL_PROPERTIES: URLProperty[];
export interface URLProperty {
name: keyof Features;
type: Type;
}
export declare function isWebGLVersionEnabled(webGLVersion: 1 | 2): boolean;
export declare function getWebGLMaxTextureSize(webGLVersion: number): number;
export declare function getMaxTexturesInShader(webGLVersion: number): number;
export declare function getWebGLDisjointQueryTimerVersion(webGLVersion: number): number;
export declare function isRenderToFloatTextureEnabled(webGLVersion: number): boolean;
export declare function isDownloadFloatTextureEnabled(webGLVersion: number): boolean;
export declare function isWebGLFenceEnabled(webGLVersion: number): boolean;
export declare function isChrome(): boolean;
export declare function getFeaturesFromURL(): Features;
export declare function getQueryParams(queryString: string): {
[key: string]: string;
};
export declare const BEFORE_PAGING_CONSTANT = 600;
export declare function getNumMBBeforePaging(): number;