YOLO (Redmon et al., 2016) divides the image into an S by S grid. The cell that contains an object's centre is responsible for predicting it, so each object has exactly one responsible cell.
Implement cell_index(x, y, img, S), returning the grid cell that contains the object centre.
Scale the coordinate to grid units, floor it, and clamp to S - 1.
No results yet
Run your code to check it against the examples, or submit to run every test.