main

fun main()
fun main()
fun main()
fun main()
fun main()
fun main()
fun main()
fun main()
fun main()

This examples demonstrates the inference concept on ResNet'50 model and model, model weight export and import back:

  • Model configuration, model weights and labels are obtained from TFModelHub.

  • Weights are loaded from .h5 file, configuration is loaded from .json file.

  • Model predicts on a few images located in resources.

  • Special preprocessing (used in ResNet'50 during training on ImageNet dataset) is applied to images before prediction.

  • Model is exported in both: Keras-style JSON format and graph .pb format ; weights are exported in custom (TXT) format.

  • It saves all the data to the project root directory.

  • The first TensorFlowInferenceModel is created via graph and weights loading.

  • Model again predicts on a few images located in resources.

  • The second Functional model is created via JSON configuration and weights loading.

  • Model again predicts on a few images located in resources.