diff --git a/src/engine/PATH_MODEL.json b/src/engine/PATH_MODEL.json deleted file mode 100644 index 035a59bf..00000000 --- a/src/engine/PATH_MODEL.json +++ /dev/null @@ -1,1870 +0,0 @@ -{ - "format": "layers-model", - "generatedBy": "keras v2.3.1", - "convertedBy": "TensorFlow.js Converter v1.5.2", - "modelTopology": { - "keras_version": "2.3.1", - "backend": "tensorflow", - "model_config": { - "class_name": "Model", - "config": { - "name": "model_4", - "layers": [ - { - "name": "input_1", - "class_name": "InputLayer", - "config": { - "batch_input_shape": [ - null, - 320, - 480, - 3 - ], - "dtype": "float32", - "sparse": false, - "name": "input_1" - }, - "inbound_nodes": [] - }, - { - "name": "block1_conv1", - "class_name": "Conv2D", - "config": { - "name": "block1_conv1", - "trainable": true, - "dtype": "float32", - "filters": 64, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "input_1", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block1_conv2", - "class_name": "Conv2D", - "config": { - "name": "block1_conv2", - "trainable": true, - "dtype": "float32", - "filters": 64, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "block1_conv1", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block1_pool", - "class_name": "MaxPooling2D", - "config": { - "name": "block1_pool", - "trainable": true, - "dtype": "float32", - "pool_size": [ - 2, - 2 - ], - "padding": "valid", - "strides": [ - 2, - 2 - ], - "data_format": "channels_last" - }, - "inbound_nodes": [ - [ - [ - "block1_conv2", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block2_conv1", - "class_name": "Conv2D", - "config": { - "name": "block2_conv1", - "trainable": true, - "dtype": "float32", - "filters": 128, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "block1_pool", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block2_conv2", - "class_name": "Conv2D", - "config": { - "name": "block2_conv2", - "trainable": true, - "dtype": "float32", - "filters": 128, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "block2_conv1", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block2_pool", - "class_name": "MaxPooling2D", - "config": { - "name": "block2_pool", - "trainable": true, - "dtype": "float32", - "pool_size": [ - 2, - 2 - ], - "padding": "valid", - "strides": [ - 2, - 2 - ], - "data_format": "channels_last" - }, - "inbound_nodes": [ - [ - [ - "block2_conv2", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block3_conv1", - "class_name": "Conv2D", - "config": { - "name": "block3_conv1", - "trainable": true, - "dtype": "float32", - "filters": 256, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "block2_pool", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block3_conv2", - "class_name": "Conv2D", - "config": { - "name": "block3_conv2", - "trainable": true, - "dtype": "float32", - "filters": 256, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "block3_conv1", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block3_conv3", - "class_name": "Conv2D", - "config": { - "name": "block3_conv3", - "trainable": true, - "dtype": "float32", - "filters": 256, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "block3_conv2", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block3_pool", - "class_name": "MaxPooling2D", - "config": { - "name": "block3_pool", - "trainable": true, - "dtype": "float32", - "pool_size": [ - 2, - 2 - ], - "padding": "valid", - "strides": [ - 2, - 2 - ], - "data_format": "channels_last" - }, - "inbound_nodes": [ - [ - [ - "block3_conv3", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block4_conv1", - "class_name": "Conv2D", - "config": { - "name": "block4_conv1", - "trainable": true, - "dtype": "float32", - "filters": 512, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "block3_pool", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block4_conv2", - "class_name": "Conv2D", - "config": { - "name": "block4_conv2", - "trainable": true, - "dtype": "float32", - "filters": 512, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "block4_conv1", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block4_conv3", - "class_name": "Conv2D", - "config": { - "name": "block4_conv3", - "trainable": true, - "dtype": "float32", - "filters": 512, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "relu", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "block4_conv2", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "block4_pool", - "class_name": "MaxPooling2D", - "config": { - "name": "block4_pool", - "trainable": true, - "dtype": "float32", - "pool_size": [ - 2, - 2 - ], - "padding": "valid", - "strides": [ - 2, - 2 - ], - "data_format": "channels_last" - }, - "inbound_nodes": [ - [ - [ - "block4_conv3", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "zero_padding2d_1", - "class_name": "ZeroPadding2D", - "config": { - "name": "zero_padding2d_1", - "trainable": true, - "dtype": "float32", - "padding": [ - [ - 1, - 1 - ], - [ - 1, - 1 - ] - ], - "data_format": "channels_last" - }, - "inbound_nodes": [ - [ - [ - "block4_pool", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "conv2d_1", - "class_name": "Conv2D", - "config": { - "name": "conv2d_1", - "trainable": true, - "dtype": "float32", - "filters": 512, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "valid", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "linear", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "zero_padding2d_1", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "batch_normalization_1", - "class_name": "BatchNormalization", - "config": { - "name": "batch_normalization_1", - "trainable": true, - "dtype": "float32", - "axis": -1, - "momentum": 0.99, - "epsilon": 0.001, - "center": true, - "scale": true, - "beta_initializer": { - "class_name": "Zeros", - "config": {} - }, - "gamma_initializer": { - "class_name": "Ones", - "config": {} - }, - "moving_mean_initializer": { - "class_name": "Zeros", - "config": {} - }, - "moving_variance_initializer": { - "class_name": "Ones", - "config": {} - }, - "beta_regularizer": null, - "gamma_regularizer": null, - "beta_constraint": null, - "gamma_constraint": null - }, - "inbound_nodes": [ - [ - [ - "conv2d_1", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "up_sampling2d_1", - "class_name": "UpSampling2D", - "config": { - "name": "up_sampling2d_1", - "trainable": true, - "dtype": "float32", - "size": [ - 2, - 2 - ], - "data_format": "channels_last", - "interpolation": "nearest" - }, - "inbound_nodes": [ - [ - [ - "batch_normalization_1", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "concatenate_1", - "class_name": "Concatenate", - "config": { - "name": "concatenate_1", - "trainable": true, - "dtype": "float32", - "axis": -1 - }, - "inbound_nodes": [ - [ - [ - "up_sampling2d_1", - 0, - 0, - {} - ], - [ - "block3_pool", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "zero_padding2d_2", - "class_name": "ZeroPadding2D", - "config": { - "name": "zero_padding2d_2", - "trainable": true, - "dtype": "float32", - "padding": [ - [ - 1, - 1 - ], - [ - 1, - 1 - ] - ], - "data_format": "channels_last" - }, - "inbound_nodes": [ - [ - [ - "concatenate_1", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "conv2d_2", - "class_name": "Conv2D", - "config": { - "name": "conv2d_2", - "trainable": true, - "dtype": "float32", - "filters": 256, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "valid", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "linear", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "zero_padding2d_2", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "batch_normalization_2", - "class_name": "BatchNormalization", - "config": { - "name": "batch_normalization_2", - "trainable": true, - "dtype": "float32", - "axis": -1, - "momentum": 0.99, - "epsilon": 0.001, - "center": true, - "scale": true, - "beta_initializer": { - "class_name": "Zeros", - "config": {} - }, - "gamma_initializer": { - "class_name": "Ones", - "config": {} - }, - "moving_mean_initializer": { - "class_name": "Zeros", - "config": {} - }, - "moving_variance_initializer": { - "class_name": "Ones", - "config": {} - }, - "beta_regularizer": null, - "gamma_regularizer": null, - "beta_constraint": null, - "gamma_constraint": null - }, - "inbound_nodes": [ - [ - [ - "conv2d_2", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "up_sampling2d_2", - "class_name": "UpSampling2D", - "config": { - "name": "up_sampling2d_2", - "trainable": true, - "dtype": "float32", - "size": [ - 2, - 2 - ], - "data_format": "channels_last", - "interpolation": "nearest" - }, - "inbound_nodes": [ - [ - [ - "batch_normalization_2", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "concatenate_2", - "class_name": "Concatenate", - "config": { - "name": "concatenate_2", - "trainable": true, - "dtype": "float32", - "axis": -1 - }, - "inbound_nodes": [ - [ - [ - "up_sampling2d_2", - 0, - 0, - {} - ], - [ - "block2_pool", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "zero_padding2d_3", - "class_name": "ZeroPadding2D", - "config": { - "name": "zero_padding2d_3", - "trainable": true, - "dtype": "float32", - "padding": [ - [ - 1, - 1 - ], - [ - 1, - 1 - ] - ], - "data_format": "channels_last" - }, - "inbound_nodes": [ - [ - [ - "concatenate_2", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "conv2d_3", - "class_name": "Conv2D", - "config": { - "name": "conv2d_3", - "trainable": true, - "dtype": "float32", - "filters": 128, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "valid", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "linear", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "zero_padding2d_3", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "batch_normalization_3", - "class_name": "BatchNormalization", - "config": { - "name": "batch_normalization_3", - "trainable": true, - "dtype": "float32", - "axis": -1, - "momentum": 0.99, - "epsilon": 0.001, - "center": true, - "scale": true, - "beta_initializer": { - "class_name": "Zeros", - "config": {} - }, - "gamma_initializer": { - "class_name": "Ones", - "config": {} - }, - "moving_mean_initializer": { - "class_name": "Zeros", - "config": {} - }, - "moving_variance_initializer": { - "class_name": "Ones", - "config": {} - }, - "beta_regularizer": null, - "gamma_regularizer": null, - "beta_constraint": null, - "gamma_constraint": null - }, - "inbound_nodes": [ - [ - [ - "conv2d_3", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "up_sampling2d_3", - "class_name": "UpSampling2D", - "config": { - "name": "up_sampling2d_3", - "trainable": true, - "dtype": "float32", - "size": [ - 2, - 2 - ], - "data_format": "channels_last", - "interpolation": "nearest" - }, - "inbound_nodes": [ - [ - [ - "batch_normalization_3", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "concatenate_3", - "class_name": "Concatenate", - "config": { - "name": "concatenate_3", - "trainable": true, - "dtype": "float32", - "axis": -1 - }, - "inbound_nodes": [ - [ - [ - "up_sampling2d_3", - 0, - 0, - {} - ], - [ - "block1_pool", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "zero_padding2d_4", - "class_name": "ZeroPadding2D", - "config": { - "name": "zero_padding2d_4", - "trainable": true, - "dtype": "float32", - "padding": [ - [ - 1, - 1 - ], - [ - 1, - 1 - ] - ], - "data_format": "channels_last" - }, - "inbound_nodes": [ - [ - [ - "concatenate_3", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "conv2d_4", - "class_name": "Conv2D", - "config": { - "name": "conv2d_4", - "trainable": true, - "dtype": "float32", - "filters": 64, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "valid", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "linear", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "zero_padding2d_4", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "batch_normalization_4", - "class_name": "BatchNormalization", - "config": { - "name": "batch_normalization_4", - "trainable": true, - "dtype": "float32", - "axis": -1, - "momentum": 0.99, - "epsilon": 0.001, - "center": true, - "scale": true, - "beta_initializer": { - "class_name": "Zeros", - "config": {} - }, - "gamma_initializer": { - "class_name": "Ones", - "config": {} - }, - "moving_mean_initializer": { - "class_name": "Zeros", - "config": {} - }, - "moving_variance_initializer": { - "class_name": "Ones", - "config": {} - }, - "beta_regularizer": null, - "gamma_regularizer": null, - "beta_constraint": null, - "gamma_constraint": null - }, - "inbound_nodes": [ - [ - [ - "conv2d_4", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "conv2d_5", - "class_name": "Conv2D", - "config": { - "name": "conv2d_5", - "trainable": true, - "dtype": "float32", - "filters": 96, - "kernel_size": [ - 3, - 3 - ], - "strides": [ - 1, - 1 - ], - "padding": "same", - "data_format": "channels_last", - "dilation_rate": [ - 1, - 1 - ], - "activation": "linear", - "use_bias": true, - "kernel_initializer": { - "class_name": "VarianceScaling", - "config": { - "scale": 1.0, - "mode": "fan_avg", - "distribution": "uniform", - "seed": null - } - }, - "bias_initializer": { - "class_name": "Zeros", - "config": {} - }, - "kernel_regularizer": null, - "bias_regularizer": null, - "activity_regularizer": null, - "kernel_constraint": null, - "bias_constraint": null - }, - "inbound_nodes": [ - [ - [ - "batch_normalization_4", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "reshape_1", - "class_name": "Reshape", - "config": { - "name": "reshape_1", - "trainable": true, - "dtype": "float32", - "target_shape": [ - 38400, - -1 - ] - }, - "inbound_nodes": [ - [ - [ - "conv2d_5", - 0, - 0, - {} - ] - ] - ] - }, - { - "name": "activation_1", - "class_name": "Activation", - "config": { - "name": "activation_1", - "trainable": true, - "dtype": "float32", - "activation": "softmax" - }, - "inbound_nodes": [ - [ - [ - "reshape_1", - 0, - 0, - {} - ] - ] - ] - } - ], - "input_layers": [ - [ - "input_1", - 0, - 0 - ] - ], - "output_layers": [ - [ - "activation_1", - 0, - 0 - ] - ] - } - }, - "training_config": { - "optimizer_config": { - "class_name": "Adadelta", - "config": { - "learning_rate": 1.0, - "rho": 0.95, - "decay": 0.0, - "epsilon": 1e-07 - } - }, - "loss": "categorical_crossentropy", - "metrics": [ - "accuracy" - ], - "weighted_metrics": null, - "sample_weight_mode": null, - "loss_weights": null - } - }, - "weightsManifest": [ - { - "paths": [ - "group1-shard1of12.bin", - "group1-shard2of12.bin", - "group1-shard3of12.bin", - "group1-shard4of12.bin", - "group1-shard5of12.bin", - "group1-shard6of12.bin", - "group1-shard7of12.bin", - "group1-shard8of12.bin", - "group1-shard9of12.bin", - "group1-shard10of12.bin", - "group1-shard11of12.bin", - "group1-shard12of12.bin" - ], - "weights": [ - { - "name": "batch_normalization_1/gamma", - "shape": [ - 512 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_1/beta", - "shape": [ - 512 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_1/moving_mean", - "shape": [ - 512 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_1/moving_variance", - "shape": [ - 512 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_2/gamma", - "shape": [ - 256 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_2/beta", - "shape": [ - 256 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_2/moving_mean", - "shape": [ - 256 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_2/moving_variance", - "shape": [ - 256 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_3/gamma", - "shape": [ - 128 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_3/beta", - "shape": [ - 128 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_3/moving_mean", - "shape": [ - 128 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_3/moving_variance", - "shape": [ - 128 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_4/gamma", - "shape": [ - 64 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_4/beta", - "shape": [ - 64 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_4/moving_mean", - "shape": [ - 64 - ], - "dtype": "float32" - }, - { - "name": "batch_normalization_4/moving_variance", - "shape": [ - 64 - ], - "dtype": "float32" - }, - { - "name": "block1_conv1/kernel", - "shape": [ - 3, - 3, - 3, - 64 - ], - "dtype": "float32" - }, - { - "name": "block1_conv1/bias", - "shape": [ - 64 - ], - "dtype": "float32" - }, - { - "name": "block1_conv2/kernel", - "shape": [ - 3, - 3, - 64, - 64 - ], - "dtype": "float32" - }, - { - "name": "block1_conv2/bias", - "shape": [ - 64 - ], - "dtype": "float32" - }, - { - "name": "block2_conv1/kernel", - "shape": [ - 3, - 3, - 64, - 128 - ], - "dtype": "float32" - }, - { - "name": "block2_conv1/bias", - "shape": [ - 128 - ], - "dtype": "float32" - }, - { - "name": "block2_conv2/kernel", - "shape": [ - 3, - 3, - 128, - 128 - ], - "dtype": "float32" - }, - { - "name": "block2_conv2/bias", - "shape": [ - 128 - ], - "dtype": "float32" - }, - { - "name": "block3_conv1/kernel", - "shape": [ - 3, - 3, - 128, - 256 - ], - "dtype": "float32" - }, - { - "name": "block3_conv1/bias", - "shape": [ - 256 - ], - "dtype": "float32" - }, - { - "name": "block3_conv2/kernel", - "shape": [ - 3, - 3, - 256, - 256 - ], - "dtype": "float32" - }, - { - "name": "block3_conv2/bias", - "shape": [ - 256 - ], - "dtype": "float32" - }, - { - "name": "block3_conv3/kernel", - "shape": [ - 3, - 3, - 256, - 256 - ], - "dtype": "float32" - }, - { - "name": "block3_conv3/bias", - "shape": [ - 256 - ], - "dtype": "float32" - }, - { - "name": "block4_conv1/kernel", - "shape": [ - 3, - 3, - 256, - 512 - ], - "dtype": "float32" - }, - { - "name": "block4_conv1/bias", - "shape": [ - 512 - ], - "dtype": "float32" - }, - { - "name": "block4_conv2/kernel", - "shape": [ - 3, - 3, - 512, - 512 - ], - "dtype": "float32" - }, - { - "name": "block4_conv2/bias", - "shape": [ - 512 - ], - "dtype": "float32" - }, - { - "name": "block4_conv3/kernel", - "shape": [ - 3, - 3, - 512, - 512 - ], - "dtype": "float32" - }, - { - "name": "block4_conv3/bias", - "shape": [ - 512 - ], - "dtype": "float32" - }, - { - "name": "conv2d_1/kernel", - "shape": [ - 3, - 3, - 512, - 512 - ], - "dtype": "float32" - }, - { - "name": "conv2d_1/bias", - "shape": [ - 512 - ], - "dtype": "float32" - }, - { - "name": "conv2d_2/kernel", - "shape": [ - 3, - 3, - 768, - 256 - ], - "dtype": "float32" - }, - { - "name": "conv2d_2/bias", - "shape": [ - 256 - ], - "dtype": "float32" - }, - { - "name": "conv2d_3/kernel", - "shape": [ - 3, - 3, - 384, - 128 - ], - "dtype": "float32" - }, - { - "name": "conv2d_3/bias", - "shape": [ - 128 - ], - "dtype": "float32" - }, - { - "name": "conv2d_4/kernel", - "shape": [ - 3, - 3, - 192, - 64 - ], - "dtype": "float32" - }, - { - "name": "conv2d_4/bias", - "shape": [ - 64 - ], - "dtype": "float32" - }, - { - "name": "conv2d_5/kernel", - "shape": [ - 3, - 3, - 64, - 96 - ], - "dtype": "float32" - }, - { - "name": "conv2d_5/bias", - "shape": [ - 96 - ], - "dtype": "float32" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/engine/Segm2d.js b/src/engine/Segm2d.js index 80c1ee22..6e1fe80b 100644 --- a/src/engine/Segm2d.js +++ b/src/engine/Segm2d.js @@ -14,7 +14,7 @@ // ******************************************************** import * as tf from '@tensorflow/tfjs'; -import PATH_MODEL from './PATH_MODEL.json'; +const PATH_MODEL = 'http://lugachai.ru/med3web/tfjs/model.json'; // ******************************************************** // Const @@ -35,7 +35,6 @@ const STAGE_MODEL_IS_LOADING = 1; const STAGE_MODEL_READY = 2; const STAGE_IMAGE_PROCESSED = 3; const STAGE_SEGMENTATION_READY = 4; -// const STAGE_READY_NEXT_IMAGE = 5; const OUT_W = 240; const OUT_H = 160; @@ -136,6 +135,9 @@ class Segm2d { } async startApplyImage() { + if (this.stage === STAGE_SEGMENTATION_READY) { + return; + } this.stage = STAGE_IMAGE_PROCESSED; console.log('Start apply segm to image ...'); @@ -267,9 +269,9 @@ class Segm2d { getStageString() { return [ 'Wait. Model is not loaded', // const STAGE_MODEL_NOT_LOADED = 0; - 'Wait. Model is loading ...', // const STAGE_MODEL_IS_LOADING = 1; + 'Loading TensorFlow model from server...', // const STAGE_MODEL_IS_LOADING = 1; 'Model is ready', // const STAGE_MODEL_READY = 2; - 'Image is processed ...', // const STAGE_IMAGE_PROCESSED = 3; + 'Image is processed...', // const STAGE_IMAGE_PROCESSED = 3; 'Segmentation is ready', // const STAGE_SEGMENTATION_READY = 4; ][this.stage]; } @@ -288,7 +290,6 @@ class Segm2d { const strMessage = this.getStageString(); console.log('Segm2d render. stage = ' + strMessage); - /* // load model if (this.model === null) { this.onLoadModel(); @@ -299,7 +300,6 @@ class Segm2d { return; } } // if model non null - */ if (this.stage === STAGE_SEGMENTATION_READY && this.pixels !== null) { // draw pixels array on screen @@ -315,26 +315,32 @@ class Segm2d { } // clear screen - ctx.fillStyle = 'rgb(64, 64, 64)'; - ctx.fillRect(0, 0, w, h); - // draw cross - ctx.strokeStyle = '#FF0000'; - - ctx.beginPath(); - ctx.moveTo(0, 0); - ctx.lineTo(w - 1, h - 1); - ctx.stroke(); - - ctx.beginPath(); - ctx.moveTo(w - 1, 0); - ctx.lineTo(0, h - 1); - ctx.stroke(); + ctx.fillStyle = '#242424'; + drawRoundedRect(ctx, 30, 0, w, h, 20); + // draw wait message const strMsgPrint = this.getStageString(); - ctx.font = '24px serif'; - ctx.fillStyle = 'rgb(64, 255, 64)'; - ctx.fillText(strMsgPrint, w / 2, h / 2); + ctx.font = '24px sans-serif'; + ctx.fillStyle = '#dc5e47'; + const textWidth = ctx.measureText(strMsgPrint).width; + const x = (w - textWidth) / 2; + const y = h / 2; + ctx.fillText(strMsgPrint, x, y); } } +function drawRoundedRect(ctx, x, y, width, height, borderRadius) { + if (width < 2 * borderRadius) borderRadius = width / 2; + if (height < 2 * borderRadius) borderRadius = height / 2; + ctx.beginPath(); + ctx.moveTo(x + borderRadius, y); + ctx.arcTo(x + width, y, x + width, y + height, borderRadius); + ctx.arcTo(x + width, y + height, x, y + height, borderRadius); + ctx.arcTo(x, y + height, x, y, borderRadius); + ctx.arcTo(x, y, x + width, y, borderRadius); + ctx.closePath(); + ctx.stroke(); + ctx.fill(); +} + export default Segm2d; diff --git a/src/ui/Panels/Properties2d/SegmentationProperty.jsx b/src/ui/Panels/Properties2d/SegmentationProperty.jsx index f12274e5..35c4726e 100644 --- a/src/ui/Panels/Properties2d/SegmentationProperty.jsx +++ b/src/ui/Panels/Properties2d/SegmentationProperty.jsx @@ -31,12 +31,10 @@ export const SegmentationProperty = () => { return ( <> - You can use automatic 2d image segmentation only for brain-like data - Segmentation 2d (brain only) + AI Brain Segmentation (Beta): - Switch checker above on and see segmentation result on right ); };