Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium
      Intuition
      88 of 114

      One box per face

      A face detector fires several boxes on every face, each with a score: how sure it is. Write keep(scores, overlap): given the scores of one photo’s boxes and overlap[i][j], how much boxes i and j overlap (from 0 to 1, as in Did the box hit?), say which boxes to keep so that every face ends up with one box, its surest. Boxes on the same face overlap by more than 0.5.

      A photo booth’s strip of four photos, and the boxes a face detector fires on every face, each with how sure it is. Keeping every box, or only the surest one, both go wrong. The goal is one box on every face, like photos 1 to 3 at the end. Your keep(scores, overlap) gets one photo’s boxes.

      A photo booth snaps four photos of Mia and Leo. A face detector looks at each.1 · alone2 · far apart3 · cheek to cheek4 · squeezed in
      Your functionkeep(scores, overlap)
      scoreshow sure the detector is of each box, e.g. [0.6, 0.9, 0.7, 0.8]e.g. [0.6, 0.9, 0.7, 0.8]
      overlapoverlap[i][j] is how much boxes i and j overlap, from 0 to 1 (boxes on the same face: more than 0.5)e.g. [[1, 0.73, 0.59, 0.65], [0.73, 1, 0.75, 0.…
      returnsone True or False per box, in the same order as scores: True to keep the box
      solution.pyLoading Python
      Sign in for an AI hint
      ← Did the box hit?Find the patch →