Using pre-trained models

Let's now see the main components of using pre-trained TensorFlow object detection models for inference in the Python notebook. First, some key constants are defined:

MODEL_NAME = 'ssd_mobilenet_v1_coco_2017_11_17'MODEL_FILE = MODEL_NAME + '.tar.gz'DOWNLOAD_BASE = 'http://download.tensorflow.org/models/object_detection/'PATH_TO_CKPT = MODEL_NAME + '/frozen_inference_graph.pb'PATH_TO_LABELS = os.path.join('data', 'mscoco_label_map.pbtxt')NUM_CLASSES = 90

The notebook code downloads and uses a pre-trained object detection model, ssd_mobilenet_v1_coco_2017_11_17 (built with the SSD method, which we talked briefly in the previous section, on top of the MobileNet CNN model, which we covered in the previous chapter). A ...

Get Intelligent Mobile Projects with TensorFlow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.