UNPKG

tensorflow-helpers

Version:

Helper functions to use tensorflow in nodejs for transfer learning, image classification, and more

133 lines (132 loc) 6.39 kB
export type ImageModelSpec = { url: string; width: number; height: number; channels: number; features: number; spatial_features?: SpatialFeatures; spatial_layers?: SpatialLayer[]; }; export type SpatialFeatures = [ batch: number, height: number, width: number, features: number ]; export type SpatialLayer = { name: string; layer: number; shape: SpatialFeatures; }; export declare const PreTrainedImageModels: { mobilenet: { 'mobilenet-v3-large-100': { url: "https://www.kaggle.com/models/google/mobilenet-v3/TfJs/large-100-224-feature-vector/1"; width: 224; height: 224; channels: 3; features: 1280; spatial_features: [1, 7, 7, 160]; spatial_layers: [{ readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_2/project/BatchNorm/FusedBatchNormV3"; readonly layer: 2; readonly shape: [1, 56, 56, 24]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_5/project/BatchNorm/FusedBatchNormV3"; readonly layer: 5; readonly shape: [1, 28, 28, 40]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_9/project/BatchNorm/FusedBatchNormV3"; readonly layer: 9; readonly shape: [1, 14, 14, 80]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_11/project/BatchNorm/FusedBatchNormV3"; readonly layer: 11; readonly shape: [1, 14, 14, 112]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_14/project/BatchNorm/FusedBatchNormV3"; readonly layer: 14; readonly shape: [1, 7, 7, 160]; }]; }; 'mobilenet-v3-large-75': { url: "https://www.kaggle.com/models/google/mobilenet-v3/TfJs/large-075-224-feature-vector/1"; width: 224; height: 224; channels: 3; features: 1280; spatial_features: [1, 7, 7, 120]; spatial_layers: [{ readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_2/project/BatchNorm/FusedBatchNormV3"; readonly layer: 2; readonly shape: [1, 56, 56, 24]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_5/project/BatchNorm/FusedBatchNormV3"; readonly layer: 5; readonly shape: [1, 28, 28, 32]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_9/project/BatchNorm/FusedBatchNormV3"; readonly layer: 9; readonly shape: [1, 14, 14, 64]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_11/project/BatchNorm/FusedBatchNormV3"; readonly layer: 11; readonly shape: [1, 14, 14, 88]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_14/project/BatchNorm/FusedBatchNormV3"; readonly layer: 14; readonly shape: [1, 7, 7, 120]; }]; }; 'mobilenet-v3-small-100': { url: "https://www.kaggle.com/models/google/mobilenet-v3/TfJs/small-100-224-feature-vector/1"; width: 224; height: 224; channels: 3; features: 1280; spatial_features: [1, 7, 7, 96]; spatial_layers: [{ readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_2/project/BatchNorm/FusedBatchNormV3"; readonly layer: 2; readonly shape: [1, 28, 28, 24]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_5/project/BatchNorm/FusedBatchNormV3"; readonly layer: 5; readonly shape: [1, 14, 14, 40]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_7/project/BatchNorm/FusedBatchNormV3"; readonly layer: 7; readonly shape: [1, 14, 14, 48]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_10/project/BatchNorm/FusedBatchNormV3"; readonly layer: 10; readonly shape: [1, 7, 7, 96]; }]; }; 'mobilenet-v3-small-75': { url: "https://www.kaggle.com/models/google/mobilenet-v3/TfJs/small-075-224-feature-vector/1"; width: 224; height: 224; channels: 3; features: 1280; spatial_features: [1, 7, 7, 72]; spatial_layers: [{ readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_2/project/BatchNorm/FusedBatchNormV3"; readonly layer: 2; readonly shape: [1, 28, 28, 24]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_5/project/BatchNorm/FusedBatchNormV3"; readonly layer: 5; readonly shape: [1, 14, 14, 32]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_7/project/BatchNorm/FusedBatchNormV3"; readonly layer: 7; readonly shape: [1, 14, 14, 40]; }, { readonly name: "StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_10/project/BatchNorm/FusedBatchNormV3"; readonly layer: 10; readonly shape: [1, 7, 7, 72]; }]; }; }; };