{% extends "layout.html" %} {% block body %} {{ super() }}
This is an image classification demo based on tensorflowjs. The backend model is mobilenet pretrained on ImageNet. The top-N predictions are given.

Log

1. Install tensorflowjs.

pip install -i https://mirrors.aliyun.com/pypi/simple/ tensorflowjs

2. Convert the DNN model to the web format.

import tensorflowjs.converters
from tensorflowjs.converters import converter
converter.dispatch_keras_h5_to_tfjs_layers_model_conversion( 'C:/github/tfjs-examples/mobilenet/mobilenet_2_5_224_tf.h5', 'C:/github/tfjs-examples/mobilenet/converted', split_weights_by_layer=True)

3. After the conversions, the model.json has an empty 'modelTopology', populate this node from the original model.json

{% endblock %}