In this article
Before you start
Why interviewers ask this
Computer-vision screens ask how a detector works end to end, not only what it is called, so a name alone does not answer it. "How does YOLO find objects in one pass?" and "What are intersection over union (IoU) and non-maximum suppression?" are common forms. A weak answer says YOLO is "a fast model". A strong answer says what one pass outputs, how scores are formed, how overlap is measured and why duplicates must be removed. The question also checks whether a candidate can separate the Darknet framework, the YOLO method and the Darknet-53 network inside YOLOv3. Mixing up those three names is a frequent slip, and one sentence fixes it.
YOLO and Darknet from first principles
- Darknet
- Darknet is an open-source neural network framework, written in C and CUDA, that trains and runs networks on a processor or a graphics card, and in which the YOLO detectors were built and released.
- YOLO
- You Only Look Once (YOLO) is a family of object detectors that predict bounding boxes and class probabilities for a whole image in a single pass of one neural network, instead of running a separate classifier over many cropped regions.
- Anchor box
- An anchor box is a reference rectangle of fixed width and height that a detector adjusts to fit an object, so the network predicts small corrections to a typical shape instead of the box from scratch.
- Non-maximum suppression
- Non-maximum suppression is a post-processing step that keeps the highest-scoring box among a group of boxes that overlap heavily and discards the rest, so one object yields one detection.
In plain words
Picture tracing paper with a grid, laid over a photograph. For each square you ask one question: does an object's centre sit here, and what is it? Every square answers at once. No one sweeps a magnifying glass over the picture. The analogy breaks in one place: several squares can claim the same object, so the page fills with near-identical rectangles to clean up.
Precisely, YOLO is a convolutional network whose output is a grid of numbers. Each grid position holds the box, confidence and class predictions for objects centred there. The original YOLO paper states that the detection pipeline is a single network, so it can be optimised end to end.
Darknet, YOLO and Darknet-53: three names, three things
Darknet is the tool, YOLO is the method, and Darknet-53 is one network that YOLOv3 uses. Joseph Redmon's Darknet page calls Darknet "an open source neural network framework written in C and CUDA", where CUDA is NVIDIA's platform for running general programs on its graphics processors. The YOLO paper adds that its authors used the Darknet framework for all training and inference.
The framework has changed hands. The Darknet/YOLO repository README (the GitHub mirror; the repository moved to Codeberg in August 2025) says Redmon developed the original from 2013 to 2017, Alexey Bochkovskiy maintained the next popular version until 2021, and since 2023 a repository sponsored by Hank.ai has been maintained by Stephane Charette; it is Apache-2.0 licensed. A model is a .cfg file that describes the layers plus a .weights file of trained numbers, with a .names file for the class labels; training also uses a .data file.
Step 1: Resize the image and cut it into a grid
The detector first resizes the image to a fixed size and lets the network produce a grid of predictions. In the first YOLO the input is 448 by 448 pixels and the grid is 7 by 7 (YOLO paper). In YOLOv3, our example uses a 416 by 416 input; the three output grids are 13 by 13, 26 by 26 and 52 by 52, because the network downsamples by factors of 32, 16 and 8.1
The input is a picture and the output is a grid of cells, each responsible for objects whose centre falls inside it. For the first YOLO, each cell predicts 2 boxes and one set of 20 class probabilities, giving a tensor, a block of numbers with three dimensions, here 7 by 7 by 30, which is 1,470 numbers per image and 98 boxes.1 The paper contrasts that 98 with about 2,000 boxes from the Selective Search method.
Step 2: Predict boxes at three scales with anchor boxes
YOLOv3 predicts boxes at three scales, and each cell at each scale predicts three boxes. The YOLOv3 report says the tensor at each scale is N by N by [3 times (4 + 1 + 80)], for 4 box offsets, 1 objectness score and 80 class scores, which is 255 channels. For a 416 by 416 image the three grids give 507, 2,028 and 8,112 boxes, so one pass yields 10,647 candidates.1
Each box starts from an anchor box. The report uses k-means clustering, which groups the training boxes into nine typical shapes, to pick nine priors on the Common Objects in Context (COCO) dataset, divided evenly across the three scales; the first is 10 by 13 pixels and the last 373 by 326 (YOLOv3 report). The network then predicts raw offsets, written t. The sigmoid squeezes any number into the range between zero and one, so the centre stays inside its cell. With c the cell's column or row and p the prior's width or height (b_x is the centre in cell units, b_w the width in pixels):
The crowd of boxes exists because every cell at every scale makes its own guesses.
Step 3: Score each box
Every box gets a score that says how likely it is to be a real object of a given class. The YOLOv3 report predicts an objectness score by logistic regression, which should be 1 when a prior overlaps a ground-truth object more than any other prior does. A softmax makes the class scores compete and sum to one, so only one class can win. Independent logistic classifiers give each class its own score between zero and one from a sigmoid, so two can both be high. The report uses the second, so a box can carry two labels such as "woman" and "person".
The input is a box with raw outputs. The output is a confidence per class. In the first YOLO the paper multiplies the class probability by the box confidence to get a class-specific confidence score that encodes both how likely the class is and how well the box fits the object. Low scores are thrown away first, using a threshold the user picks. The remaining boxes still overlap, so Step 4 measures how much.
Step 4: Measure overlap with intersection over union
Intersection over union (IoU) is the area where two boxes overlap divided by the area they cover together, a number from 0 for disjoint boxes to 1 for identical boxes. It is used in training, to judge how well a prediction fits the true box, in evaluation, to score detections against true boxes, and in Step 5, to decide whether two predicted boxes are duplicates.
Take box P with corners (50, 50) and (150, 150) and box Q with corners (80, 80) and (180, 180), both illustrative. The overlap is 70 by 70, which is 4,900 square pixels. Each box has 10,000, so together they cover 15,100, and the IoU is 0.3245.1 A value that low says the boxes mostly cover different ground. The next step needs a threshold above which two boxes count as the same object.
Step 5: Remove duplicates with non-maximum suppression
Non-maximum suppression sorts the boxes by score, keeps the best box of a class, discards every remaining box of that class whose IoU with it is above a threshold, and repeats on what is left. The first YOLO paper says it fixes multiple detections of the same object, and that it adds 2 to 3 percent in mean average precision (mAP), the standard accuracy measure for detectors.
The output is one box per object. The threshold is a design choice with a cost: set it too low and nearby objects of the same class merge into one detection, set it too high and duplicates survive. The code below ignores classes for brevity, though Darknet suppresses within each class. The worked example runs the whole procedure on five boxes.
Step-by-step description
- Resize the image and form a grid of cells.
- Each cell predicts boxes from anchors at three scales.
- Each box gets an objectness and class score.
- Intersection over union measures overlap.
- Keep the best box, drop heavy overlaps.
- One YOLOv3 pass at 416 by 416 yields 10,647 candidate boxes.
- Non-maximum suppression keeps the best box and drops boxes that overlap it above a threshold.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →Worked example
All numbers come from the saved script.1 The layer sizes follow the papers; the boxes in the overlap and suppression examples are invented for teaching.
| Detector and input | Grids | Boxes per cell | Candidate boxes |
|---|---|---|---|
| YOLO (first version), 448 by 448 | 7 by 7 | 2 | 98 |
| YOLOv3, 320 by 320 | 10, 20, 40 | 3 | 6,300 |
| YOLOv3, 416 by 416 | 13, 26, 52 | 3 | 10,647 |
| YOLOv3, 608 by 608 | 19, 38, 76 | 3 | 22,743 |
Now decode one prediction. Take a cell at column 6, row 4 on the 13 by 13 grid (stride 32), the first of the three large priors used at the 13 by 13 scale, 116 by 90 pixels, and raw outputs 0.2, minus 0.4, 0.1 and minus 0.2. The sigmoid of 0.2 is 0.5498; adding the column 6 gives a centre of 6.5498 cells, and the sigmoid of minus 0.4 plus the row 4 gives 4.4013 cells.1
Times the stride 32, the centre is (209.6, 140.8) pixels. The width is 116 times the exponential of 0.1, which is 128.2, and the height is 90 times the exponential of minus 0.2, which is 73.7. To compare this box by IoU, convert it to corners: the centre minus and plus half the width and half the height.1
Finally, suppression. Five boxes, with corners (x1, y1, x2, y2) and scores, are A (100, 100, 200, 200) 0.90; B (110, 105, 210, 205) 0.80; C (300, 120, 380, 220) 0.75; D (305, 125, 385, 225) 0.60; and E (105, 300, 175, 380) 0.30. The score threshold is 0.4 and the IoU threshold 0.5. The score threshold removes E. A and B overlap by 90 by 95, which is 8,550 square pixels, over a union of 11,450, so the IoU is 0.7467 and B is dropped. C and D overlap by 75 by 95, which is 7,125, over a union of 8,875, so the IoU is 0.8028 and D is dropped. Two detections remain: A and C.1
def iou(a, b): # boxes are (x1, y1, x2, y2)
iw = max(0, min(a[2], b[2]) - max(a[0], b[0]))
ih = max(0, min(a[3], b[3]) - max(a[1], b[1]))
inter = iw * ih
union = (a[2]-a[0])*(a[3]-a[1]) + (b[2]-b[0])*(b[3]-b[1]) - inter
return inter / union
def nms(boxes, score_min=0.4, iou_max=0.5): # boxes: (name, box, score)
todo = sorted([b for b in boxes if b[2] >= score_min], key=lambda b: -b[2])
keep = []
while todo:
best = todo.pop(0); keep.append(best)
todo = [b for b in todo if iou(best[1], b[1]) <= iou_max]
return keepText description of the diagram
- A 416 by 416 image gives 507, 2,028 and 8,112 boxes at the 13, 26 and 52 grids.
- The three scales together give 10,647 candidate boxes.
Trade-offs and edge cases
The first YOLO missed small objects in groups. The paper says so, since each grid cell predicts only two boxes and one class (YOLO paper). The YOLOv3 report says that trend reversed: with multi-scale predictions it has relatively high average precision on small objects (AP_S), but comparatively worse performance on medium and large ones, and its box fit weakens as the IoU threshold rises.
Speed is the other side of the trade. The first paper reports 45 frames per second for the base model and 155 for Fast YOLO (paper). The YOLOv3 report gives 28.2 mAP in 22 milliseconds at 320 by 320, and 57.9 average precision at an IoU of 0.5 in 51 milliseconds on a Titan X, against 57.5 in 198 milliseconds for RetinaNet.
The family kept growing. The second-generation detector paper (December 2016) reports 76.8 mAP at 67 frames per second for its YOLOv2 detector on the Visual Object Classes (VOC) 2007 test set (YOLOv2 paper abstract). The YOLOv4 paper (April 2020) by Bochkovskiy, Wang and Liao reports 43.5 average precision at about 65 frames per second on a Tesla V100. The repository lists pre-trained weights for YOLOv2, YOLOv3, YOLOv4 and YOLOv7.
Names mislead. "Darknet" can mean the framework, the repository or a backbone: Darknet-53 has 53 convolutional layers and, per the YOLOv3 report, is reported as better than ResNet-101 and 1.5 times faster.
| Fact | Value |
|---|---|
| Darknet written in | C and CUDA (Redmon's page) |
| First YOLO output tensor | 7 by 7 by 30, 98 boxes (paper; computed) |
| First YOLO speed | 45 frames per second; Fast YOLO 155 (paper) |
| YOLOv3 candidate boxes at 416 by 416 | 10,647 (computed from the report) |
| Anchor priors in YOLOv3 | 9, three per scale (report) |
| Non-maximum suppression gain in the first YOLO | 2 to 3 percent in mAP (paper) |
Text description of the diagram
- Darknet is an open-source neural network framework written in C and CUDA.
- Darknet-53 is one network that YOLOv3 uses, and it has 53 convolutional layers.
How to answer it in an interview
How does YOLO detect objects, and what is Darknet?
Darknet is the open-source C and CUDA framework that the original YOLO versions were built in, and YOLO is the detector. YOLO runs one convolutional network over the whole image. The output is a grid, and each cell predicts boxes, an objectness score and class scores, in YOLOv3 at three scales with anchor boxes, so a 416 by 416 image gives 10,647 candidates. I drop low scores, then run non-maximum suppression: keep the best box and remove any box whose intersection over union with it is above a threshold. The first YOLO missed small objects in groups; YOLOv3's three scales fixed much of that, and its weaker point is tight box fit at strict overlap thresholds.
The spoken structure is: separate the framework from the method, say what one pass outputs, then the clean-up and the cost.
Common mistakes
- Treating Darknet and YOLO as one thing. (wrong) "Darknet is the YOLO model." (right) "Darknet is the framework; YOLO is the detector, and Darknet-53 is one backbone."
- Describing YOLO as a classifier run on cropped regions. (wrong) "It crops each region and classifies it." (right) "One network scores a grid of predictions for the whole image."
- Skipping the duplicate removal. (wrong) "The network outputs the final detections directly." (right) "It outputs many candidate boxes; non-maximum suppression keeps the best."
- Calling IoU accuracy. (wrong) "IoU is the percentage of correct predictions." (right) "IoU is the overlap area divided by the combined area of two boxes."
- Claiming a grid cell can hold many classes in the first YOLO. (wrong) "Each cell predicts any number of objects." (right) "Each cell predicts two boxes and one set of class probabilities."
Follow-up questions
Is Darknet the same as YOLO?
No. Darknet is the framework that trains and runs networks, and YOLO is a detector design; YOLO versions 1 to 4 were built in it. The framework also runs other networks, including classifiers.
Why is YOLO faster than R-CNN?
YOLO runs one network once per image and produces 98 boxes in its first version, while R-CNN, short for regions with convolutional neural network features, and similar methods score about 2,000 proposed regions with a separate stage. The paper cites the Selective Search figure.
What is the difference between YOLOv3 and YOLOv4?
YOLOv3 (2018) is by Redmon and Farhadi and adds three scales, nine anchors and the Darknet-53 backbone. YOLOv4 (2020) is by Bochkovskiy, Wang and Liao and, per its abstract, combines Cross-Stage-Partial (CSP) connections, Mish activation, Mosaic data augmentation, DropBlock regularisation and a Complete IoU (CIoU) loss, reaching 43.5 average precision at about 65 frames per second on a V100.
How many boxes does YOLOv3 output at 608 by 608?
The grids become 19, 38 and 76, so 3 times (361 + 1,444 + 5,776) gives 22,743 candidates, more than twice the 10,647 at 416 by 416.1
What files does Darknet need to run a YOLO model?
Running a model needs a .cfg file for the layers, a .weights file for the trained numbers and a .names file for class labels; a .data file with paths and class count is used for training. See deep learning for the training background.
What does YOLO struggle with?
Small objects in groups, because a cell predicts only two boxes and one class in the first version, and exact box fit at strict overlap thresholds. The sigmoid that squashes raw outputs is covered in activation functions, and the shortcut connections inside Darknet-53 are residual connections. For more practice, see deep learning interview questions.
- Darknet is an open-source framework in C and CUDA; YOLO is the one-pass detector built with it; Darknet-53 is one backbone.
- YOLOv3 predicts from three grids with three anchors per cell, and most boxes come from the finest grid.
- Each box is scored, overlap is measured with intersection over union, and non-maximum suppression keeps one box per object.
- Speed comes from one network pass; the first YOLO struggled with small, crowded objects, which YOLOv3's scales largely fixed.
Sources
- Darknet: Open Source Neural Networks in C — Joseph Redmon (page shows no date; its citation reads 2013-2016; read 2026-10-24), 31 Dec 2016
- You Only Look Once: Unified, Real-Time Object Detection (arXiv 1506.02640 v5) — arXiv (Redmon, Divvala, Girshick, Farhadi), 9 May 2016
- YOLO9000: Better, Faster, Stronger (arXiv 1612.08242) — arXiv (Redmon and Farhadi), 25 Dec 2016
- YOLOv3: An Incremental Improvement (arXiv 1804.02767) — arXiv (Redmon and Farhadi), 8 Apr 2018
- YOLOv4: Optimal Speed and Accuracy of Object Detection (arXiv 2004.10934) — arXiv (Bochkovskiy, Wang, Liao), 23 Apr 2020
- Darknet/YOLO repository README — Hank.ai and Stephane Charette (page shows no date; read 2026-10-24), 24 Oct 2026