Download Resume
Approach
Dalal-Triggs HOG + SVM (2005) — the real historical middle step between Haar Cascade (2001) and deep learning (~2014+).

Still hand-engineered features — gradient-direction histograms instead of Haar's light/dark rectangles — but the classifier is a trained SVM instead of an AdaBoost cascade. Level 1 and this level are actually the same category: hand-designed features plus a learned classifier. What changes here is feature quality — gradient orientation captures shape more robustly than raw intensity contrast — not whether learning happens at all. Level 3 is the real jump: fully learned features via a neural network, not just a learned classifier bolted onto hand-designed ones.

hog = cv2.HOGDescriptor()
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
boxes, weights = hog.detectMultiScale(img, winStride=(8,8), padding=(8,8), scale=1.05)

HOG+SVM notoriously returns many overlapping duplicate boxes per person across scales and positions — getting clean single-box-per-person output required adding custom non-max suppression (IoU-based box collapsing). That's a standard, expected companion step for this detector, not optional polish.

Success case
Original, unannotated studio group photo of nine standing people
Before — the original, unannotated photo.
HOG plus SVM correctly boxing every person in the same studio group photo
After — a studio group photo of upright, standing people, correctly boxed after NMS.

Terminal output

people1.jpg -> Detected 4 pedestrian(s) after NMS
Saved annotated image as output1.jpg
Zero-detection case
Original, unannotated close cropped group portrait
Before — the original, unannotated photo.
HOG plus SVM run on the same close cropped group portrait, zero boxes drawn
After — identical to the input: zero detections, so nothing got drawn. Kept deliberately as a limitation showcase (see note below).

Terminal output

people4.jpg -> Detected 0 pedestrian(s) after NMS
Saved annotated image as output4.jpg
Worth being upfront: this second image is a tight, close-cropped group portrait — head, shoulders, arms wrapped around each other, no legs in frame. HOG+SVM's pedestrian detector is trained to match a full standing silhouette, and a crop with no legs or torso structure gives it nothing to match, which is exactly what happened here: zero detections. Small, occluded, or atypical-crop/pose subjects are where classical feature-based detectors break down — and it's a real, honest example of why the field moved to deep learning.