ResNet for image classification

The ResNet for image classification script (image_classification_opencv_restnet_50_caffe.py) will use ResNet-50 with Caffe pre-trained models to perform image classification.

The output can be seen in the following screenshot:

As shown in the previous screenshot, the top prediction corresponds to a church with a probability of 0.9955400825.

The top 10 predictions are as follows:

  • 1. label: church, probability: 0.9955400825
  • 2. label: dome, probability: 0.002429900225
  • 3. label: bell cote, probability: 0.0007424423238
  • 4. label: monastery, probability: 0.0003768313909
  • 5. label: picket fence, probability: 0.0003282549733 ...

Get Mastering OpenCV 4 with Python 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.