Set up paths of label, model, and input image
In this example, THRESHOLD allows only inference results higher than 0.6 to be responded
Load image file
image
image_np
image_np_expanded
Load model file
If you do not load a model file, ops is null.
You have to load a model file and then get tensor names.
Then you are going to create dictionary of Tensor to input into tf.Session().run.
Run inference
Run inference. feed_dict allows to input values. In this case, feed_dict inputs tensor_image made from the test image file.
Change data type of the inference result
Get labels and create a json file
If the example of pascal_label_map.pbtxt is like below,
category_index becomes like this