Session Ready
Exercise

Segmentation and face detection

Previously, you learned how to make processes more computationally efficient with unsupervised superpixel segmentation. In this exercise, you'll do just that!

Using the slic() function for segmentation, pre-process the image before passing it to the face detector.

Young woman selfie
Image preloaded as profile_image.

The Cascade class, the slic() function from segmentation module, and the show_detected_face() function for visualization have already been imported. The detector is already initialized and ready to use as detector.

Instructions
100 XP
  • Apply superpixel segmentation and obtain the segments a.k.a. labels using slic().
  • Obtain the segmented image using label2rgb(), passing the segments and profile_image.
  • Detect the faces, using the detector with multi scale method.