AI Infrastructure
An Image Can Keep Its Shape While Its Detection Box Moves
Supplied detection boxes describe the transformed image only when their coordinates follow that image's transformation. Matching input and final dimensions cannot establish the relationship. In fictional BOX214, resizing and then cropping returns the image to its original height and width, but moves its box from [60,30,100,60] to [20,10,100,70]. Both tuples fit the final canvas. Compare the declared coordinate space and mapping before treating an image and its annotations as a usable pair.
Identify which image the supplied box describes
A buyer receiving a transformed image and detection annotations needs a specific answer: are the supplied boxes expressed on the original image or on the delivered image? Either space can be deliberately supplied, but the receiving application needs an explicit relationship between them. A claim that the boxes are valid leaves that relationship open.
TorchVision 0.24 provides a concrete vocabulary. Its BoundingBoxes definition uses canvas_size for the corresponding image's height and width, in that order. An unrotated XYXY box instead lists x1, y1, x2, y2: its upper-left and lower-right corners. The x entries refer to the horizontal extent, so they relate to width; the y entries relate to height.
These are pixel-coordinate values, not fractions of the image dimensions. BOX214 below uses an axis-aligned box wholly retained by the crop. Its supplied numbers are fictional premises for coordinate arithmetic, with no image processing or detection result observed.
References: [B1]
BOX214: resize the image and its box
Stipulate an original image 100 pixels high and 200 pixels wide. Its canvas in height, width order is (100,200). The supplied annotation is XYXY [60,30,100,60], spanning x from 60 to 100 and y from 30 to 60.
The stipulated first transformation resizes the image to exactly 200 pixels high and 400 pixels wide. TorchVision 0.24's Resize documentation distinguishes a two-element height, width request from a scalar request for the shorter edge. This example uses the exact two-element output size.
The v0.24.0 unrotated box implementation scales x entries by new width / old width and y entries by new height / old height. Here those ratios are 400 / 200 = 2 and 200 / 100 = 2. The resized tuple is therefore [60 x 2,30 x 2,100 x 2,60 x 2] = [120,60,200,120].
At this intermediate boundary, the paired canvas is (200,400). The box is now 80 pixels wide and 60 pixels high, compared with its original width of 40 and height of 30. Retaining the original tuple would omit the specified scale change.
The crop gives the box a new origin
Next stipulate a crop of the resized image with top = 50 pixels, left = 100 pixels, height = 100 pixels and width = 200 pixels. The crop occupies x from 100 to 300 and y from 50 to 150 on the resized canvas. The entire resized box lies inside it.
In TorchVision v0.24.0, the XYXY crop branch subtracts [left,top,left,top] and returns the crop's height, width as the new canvas. Applying that relation gives [120 - 100,60 - 50,200 - 100,120 - 50] = [20,10,100,70]. This wholly retained box needs no boundary adjustment.
Cropping changes the coordinate origin without changing this box's 80-pixel width or 60-pixel height. Its coordinates now refer to the crop's upper-left corner. Subtracting the origin from the original, unscaled tuple would describe a different transformation order.
The final paired canvas is (100,200), exactly the original height and width. Those matching dimensions coexist with changed annotation coordinates.
References: [G1]
What the final bounds check proves
Consider a simple check for a positive-area XYXY box inside this final canvas: 0 <= x1 < x2 <= 200 and 0 <= y1 < y2 <= 100.
The incorrect unchanged tuple [60,30,100,60] passes: 0 <= 60 < 100 <= 200 and 0 <= 30 < 60 <= 100. The correctly transformed tuple [20,10,100,70] also passes: 0 <= 20 < 100 <= 200 and 0 <= 10 < 70 <= 100.
That check establishes ordered corners, positive width and height, and containment within the declared canvas. It is useful for those properties. It cannot establish which source location a box represents or whether it followed the image transformation.
The two candidates even share x2 = 100. That agreement is incidental: the specified horizontal mapping sends the original x2 of 100 to 2 x 100 - 100 = 100. Other edges move, and the box doubles in width and height. Agreement on one coordinate would therefore also leave the pairing unresolved.
The finding concerns coordinate correspondence. Whether the supplied original annotation correctly describes an object is a separate question that these premises do not answer.
Equal dimensions leave the spatial mapping unresolved
Combining BOX214's two transformations gives x_final = 2 x x_original - 100 and y_final = 2 x y_original - 50. This relationship explains the changed tuple even though the input and final canvas dimensions match.
The crop's resized-image extent corresponds to original x from 50 to 150 and original y from 25 to 75. The final 200-pixel-wide, 100-pixel-high image therefore represents a selected region of the original image at a different scale. Its width and height alone cannot identify that region.
The inverse relationship makes the handoff equally explicit: x_original = (x_final + 100) / 2 and y_original = (y_final + 50) / 2. Applying it to the correct final box recovers the supplied original box. Applying it to the unchanged tuple instead gives original-space [80,40,100,55], a different rectangle.
Canvas dimensions describe an extent. The mapping additionally connects positions across the two images. Returning canvas metadata to its original numbers does not restore the original coordinate relationship.
Compare proposals at the receiving application's coordinate space
Suppose two fictional providers deliver BOX214's final image. Offer A attaches the original tuple [60,30,100,60] and says that its bounds fit the delivered image. Offer B supplies [20,10,100,70], identifies it as final-image XYXY coordinates, and explains the resize followed by the crop.
If the requirement is boxes directly expressed on the delivered image, B accounts for the stipulated relationship. A's bounds statement leaves a missing conversion. If A intentionally supplies original-image coordinates, the application owner must identify the conversion into the displayed or consumed image space and who supplies it. The package should make that choice explicit, especially because both canvases happen to have the same dimensions.
Ask the appointed software or data-delivery owner to connect the identified source image and annotation to the delivered pair. The explanation needs the coordinate format and units, original and intermediate canvas dimensions, transformation order, exact resize output, crop origin and extent, and the coordinate space used by the receiver. BOX214 shows why final dimensions alone cannot substitute for that explanation.
A declared mapping establishes what the proposal promises. Evidence for the actual implementation must separately establish that the delivered image and annotations follow it. The buyer can then distinguish a complete coordinate handoff from a bounds-valid tuple without treating this fictional arithmetic as application acceptance.
Discuss physical installation for separately selected equipment
If the selected vision system also needs equipment receiving, rack integration, onsite installation or IT cabling, Leviathan's Complete Physical Deployment service is the relevant scope discussion. Use the related service and project inquiry with a nonconfidential equipment list, site, required connections and physical handoff needs to confirm scope, requirements and availability.
Image transformations, annotation delivery and application acceptance remain with the appointed software and data owners.
References: [L1]
Primary sources
- [B1] TorchVision v0.24.0: BoundingBoxFormat and BoundingBoxesChecked 2026-10-21. Defines XYXY corner order and canvas_size as the corresponding image's height and width. The example uses pixel coordinates for an unrotated box.
- [R1] TorchVision 0.24: ResizeChecked 2026-10-21. The size parameter distinguishes an exact height, width output from a scalar shorter-edge request. BOX214 stipulates the exact two-element size.
- [G1] TorchVision v0.24.0: bounding-box resize and crop geometryChecked 2026-10-21. The unrotated resize branch supplies width and height ratios; the XYXY crop branch subtracts the crop origin and returns its canvas. BOX214 applies these relations to supplied fictional premises with the whole box retained.
- [L1] Leviathan Systems: Complete Physical DeploymentChecked 2026-10-21. Describes equipment receiving, rack integration, onsite deployment, IT cabling and physical handoff, with the engagement's scope and availability confirmed separately.