tensorflow-helpers
Version:
Helper functions to use tensorflow in nodejs for transfer learning, image classification, and more
139 lines (138 loc) • 6.34 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PreTrainedImageModels = void 0;
exports.PreTrainedImageModels = {
mobilenet: {
// #param, accuracy, and latency see: https://keras.io/api/applications/mobilenet/#mobilenetv3large-function
'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: [
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_2/project/BatchNorm/FusedBatchNormV3',
layer: 2,
shape: [1, 56, 56, 24],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_5/project/BatchNorm/FusedBatchNormV3',
layer: 5,
shape: [1, 28, 28, 40],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_9/project/BatchNorm/FusedBatchNormV3',
layer: 9,
shape: [1, 14, 14, 80],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_11/project/BatchNorm/FusedBatchNormV3',
layer: 11,
shape: [1, 14, 14, 112],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_14/project/BatchNorm/FusedBatchNormV3',
layer: 14,
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: [
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_2/project/BatchNorm/FusedBatchNormV3',
layer: 2,
shape: [1, 56, 56, 24],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_5/project/BatchNorm/FusedBatchNormV3',
layer: 5,
shape: [1, 28, 28, 32],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_9/project/BatchNorm/FusedBatchNormV3',
layer: 9,
shape: [1, 14, 14, 64],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_11/project/BatchNorm/FusedBatchNormV3',
layer: 11,
shape: [1, 14, 14, 88],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_14/project/BatchNorm/FusedBatchNormV3',
layer: 14,
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: [
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_2/project/BatchNorm/FusedBatchNormV3',
layer: 2,
shape: [1, 28, 28, 24],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_5/project/BatchNorm/FusedBatchNormV3',
layer: 5,
shape: [1, 14, 14, 40],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_7/project/BatchNorm/FusedBatchNormV3',
layer: 7,
shape: [1, 14, 14, 48],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_10/project/BatchNorm/FusedBatchNormV3',
layer: 10,
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: [
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_2/project/BatchNorm/FusedBatchNormV3',
layer: 2,
shape: [1, 28, 28, 24],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_5/project/BatchNorm/FusedBatchNormV3',
layer: 5,
shape: [1, 14, 14, 32],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_7/project/BatchNorm/FusedBatchNormV3',
layer: 7,
shape: [1, 14, 14, 40],
},
{
name: 'StatefulPartitionedCall/StatefulPartitionedCall/predict/MobilenetV3/expanded_conv_10/project/BatchNorm/FusedBatchNormV3',
layer: 10,
shape: [1, 7, 7, 72],
},
],
},
},
};