Closed G10DRAS closed 8 years ago
Good catch! This happened when moving from Chapter 6 to Chapter 7... A classifier should either take mode
as an input argument in the constructor, or in this case hard-code it to "one-vs-all".
The strategies are explained in the book (Chapter 6): "one-vs-all": The one-vs-all strategy involves training a single classifier per class, with the samples of that class as positive samples and all other samples as negatives. For k classes, this strategy thus requires the training of k classifiers. "one-vs-one": The one-vs-one strategy involves training a single classifier per class pair, with the samples of the first class as positive samples and the samples of the second class as negative samples. For k classes, this strategy requires the training of k*(k-1)/2 classifiers.
I need to fix self.mode
and extend documentation.
Thank you for explaination, Michael !!
For now I hardcoded the mode
.
I was experimenting with both the mode
, and "one-vs-one" works well for me.
I found another bug, which is related to putText
above a detected face. x,y co-ordinate are missing in function.
chapter7.py
def _process_frame(self, frame):
........
# draw label above bounding box
cv2.putText(frame, str(label), (x, y - 20),
cv2.FONT_HERSHEY_COMPLEX, 1, (0, 255, 0), 2)
I created another issue for your reported bug above (see #6).
Closed #2 via 92c92d0e71d09b54ca94e79bd9a69509cdf5e05a.
where to set self.mode ? What is the difference between "one-vs-one" and "one-vs-all"