OpenCV 4 with Python Blueprints - Second Edition
by Dr. Menua Gevorgyan, Michael Beyeler (USD), Arsen Mamikonyan, Michael Beyeler
The single-object detector
First of all, let's look at how to predict the class in parallel with the box. In Chapter 9, Learning to Classify and Localize Objects, you also learned how to make a classifier. Nothing limits us to combining classification with localization in a single network. That is done by connecting the classification and localization blocks to the same feature map of the base network and training it all together with a loss function, which is a sum of localization and classification losses. You can create and train such a network as an exercise.
The question remains, what if there is no object in the scene? To resolve this, we can simply add one more class that corresponds to the background and assign zero to the loss of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access