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
      87 of 114

      Did the box hit?

      A detector looks for things in a photo and draws a box around each. Write overlap(box, truth): given the detector’s box and the true box, both as [left, top, right, bottom] in squares from the photo’s top-left corner, say how good the box is: 1 when it’s spot on, 0 when it misses completely.

      A detector draws boxes where it thinks the dog is; the dashed box is where the dog really is. Did it hit? Counting the dog’s squares inside each box? Both get fooled. The goal is a score like the bars it ends on: top for spot on, low for a sloppy box. Your overlap(box, truth) gets the detector’s box and the true box.

      A detector looks for the dog in this photo. The dashed box is where the dog really is.02468101214160246810
      Your functionoverlap(box, truth)
      boxthe detector's box, [left, top, right, bottom] in squares from the photo's top-left cornere.g. [5, 4, 11, 8]
      truththe true box around the thing, the same waye.g. [4, 4, 10, 8]
      returnshow good the box is: 1 when it's spot on, 0 when it misses completely
      solution.pyLoading Python
      Sign in for an AI hint
      ← How far is it?One box per face →