IoU stands for Intersection over Union. It is a metric used to measure the overlap between two areas, often between predicted and actual bounding boxes.
Click to reveal answer
beginner
How is IoU calculated?
IoU is calculated by dividing the area of overlap between the predicted bounding box and the ground truth bounding box by the area of their union.
Click to reveal answer
beginner
Why is IoU important in object detection?
IoU helps to evaluate how well the predicted bounding box matches the actual object. A higher IoU means better prediction accuracy.
Click to reveal answer
intermediate
What is a typical IoU threshold used to decide if a detection is correct?
A common IoU threshold is 0.5. If the IoU between predicted and ground truth boxes is above 0.5, the detection is considered correct.
Click to reveal answer
beginner
What happens to IoU if the predicted box and ground truth box do not overlap?
If there is no overlap, the intersection area is zero, so IoU is 0, indicating no match between predicted and actual boxes.
Click to reveal answer
What does the numerator in the IoU formula represent?
AThe area of overlap between predicted and ground truth boxes
BThe total area covered by both boxes
CThe area of the predicted box only
DThe area of the ground truth box only
✗ Incorrect
The numerator is the intersection area where both predicted and ground truth boxes overlap.
If IoU = 1, what does it mean?
ANo overlap between boxes
BPartial overlap between boxes
CPerfect overlap between boxes
DBoxes are completely separate
✗ Incorrect
IoU of 1 means the predicted box perfectly matches the ground truth box.
Which IoU value usually indicates a good detection in object detection tasks?
A0.1
B0.9
C0.3
D0.5
✗ Incorrect
An IoU of 0.5 or higher is commonly used as a threshold to consider a detection correct.
What does the denominator in the IoU formula represent?
AArea of union of predicted and ground truth boxes
BArea of predicted box only
CArea of overlap
DArea of ground truth box only
✗ Incorrect
The denominator is the union area, which is the total area covered by both boxes combined.
If two boxes do not overlap at all, what is the IoU value?
A1
B0
C0.5
DUndefined
✗ Incorrect
No overlap means intersection area is zero, so IoU is 0.
Explain what IoU (Intersection over Union) measures and why it is useful in object detection.
Think about how well predicted boxes match actual objects.
You got /4 concepts.
Describe how you would calculate IoU given two bounding boxes.
Focus on areas where boxes overlap and combine.
You got /4 concepts.
Practice
(1/5)
1. What does IoU (Intersection over Union) measure in computer vision?
easy
A. The overlap between two bounding boxes
B. The distance between two points
C. The brightness of an image
D. The number of pixels in an image
Solution
Step 1: Understand IoU definition
IoU measures how much two areas overlap compared to their total combined area.
Step 2: Identify what IoU compares
It compares two bounding boxes or regions to see how well they match.
Final Answer:
The overlap between two bounding boxes -> Option A
Quick Check:
IoU = Overlap / Union [OK]
Hint: IoU = Overlap area divided by combined area [OK]
Common Mistakes:
Confusing IoU with distance metrics
Thinking IoU measures brightness or color
Assuming IoU can be greater than 1
2. Which of the following is the correct formula for IoU between two boxes A and B?
easy
A. Area(A) + Area(B)
B. Area(A ∩ B) / Area(A ∪ B)
C. Area(A ∪ B) / Area(A ∩ B)
D. Area(A) - Area(B)
Solution
Step 1: Recall IoU formula
IoU is defined as the intersection area divided by the union area of two boxes.
Step 2: Match formula to options
Area(A ∩ B) / Area(A ∪ B) correctly shows IoU = Area of intersection over area of union.
Final Answer:
Area(A ∩ B) / Area(A ∪ B) -> Option B
Quick Check:
IoU = Intersection / Union [OK]
Hint: IoU = Intersection area ÷ Union area [OK]
Common Mistakes:
Swapping numerator and denominator
Adding areas instead of dividing
Subtracting areas instead of dividing
3. Given two bounding boxes: Box A with area 20, Box B with area 30, and their intersection area is 10, what is the IoU?
Hint: IoU = Intersection ÷ (A + B - Intersection) [OK]
Common Mistakes:
Forgetting to subtract intersection in union
Using sum of areas as union
Mixing up intersection and union values
4. Consider this Python code to compute IoU:
def iou(area_a, area_b, intersection):
union = area_a + area_b + intersection
return intersection / union
print(iou(15, 25, 5))
What is the error in this code?
medium
A. Function should return union instead of IoU
B. Intersection should be added twice in union
C. Division should be union divided by intersection
D. Union is calculated incorrectly by adding intersection instead of subtracting
Solution
Step 1: Check union calculation
Union should be area_a + area_b - intersection, not plus intersection.
Step 2: Identify impact on IoU
Adding intersection inflates union, making IoU smaller than correct value.
Final Answer:
Union is calculated incorrectly by adding intersection instead of subtracting -> Option D
Quick Check:
Union = A + B - Intersection [OK]
Hint: Union = sum of areas minus intersection [OK]
Common Mistakes:
Adding intersection instead of subtracting
Swapping numerator and denominator
Returning union instead of IoU
5. You have two predicted bounding boxes and one ground truth box. Box1 IoU with ground truth is 0.6, Box2 IoU is 0.4. If the threshold for a correct detection is 0.5, which box is considered a correct detection and why?
hard
A. Both boxes are correct because any IoU > 0 counts
B. Only Box2 is correct because it has lower IoU
C. Only Box1 is correct because its IoU is above 0.5
D. Neither box is correct because threshold is 0.7
Solution
Step 1: Understand IoU threshold meaning
Threshold 0.5 means IoU must be at least 0.5 to count as correct detection.