In this example, we will import the TensorFlow library from tfhub and use it to detect objects. TensorFlow Hub (https://www.tensorflow.org/hub) is a library where code is available and ready to use for computer vision applications. The code is extracted from TensorFlow Hub (https://github.com/tensorflow/hub/blob/master/examples/colab/object_detection.ipynb), except the image is inserted locally, rather than extracted for the cloud.
The modified code used for this exercise can be found at https://github.com/PacktPublishing/Mastering-Computer-Vision-with-TensorFlow-2.0/blob/master/Chapter10/Chapter10_Tensorflow_Object_detection_API.ipynb.
Here, we install the TensorFlow libraries by importing tensorflow_hub and six.moves. six.moves is a Python module used to provide a common package between Python 2 and Python 3. It displays an image and draws...