BoundingBox class for a defect:
Data classes
x,y: integers on Perceptron’s normalized 0–1000 grid (see below).t: optional timestamp for frames or temporal reasoning.mention: optional model-provided label.top_left,bottom_right:SinglePointcorners that define aBoundingBox.hull: ordered list ofSinglePointvalues outlining a polygon.points: list of child annotations contained in aCollection.
Canonical tags
The SDK’s serializer and parser share the same HTML-style format the models emit:- Attributes (
mention,t) live on the tag. - Whitespace around coordinates is ignored.
- Coordinates are integers on the 0–1000 grid.
- Collections can nest any mix of point, box, or polygon tags.
Collections in code
Metadata fields
mentioncarries the model’s textual label.tstores optional timestamps (handy for video frames).- Fields persist through serialization and are safe to log or display.
Normalized coordinates
All annotations live on a 0–1000 grid so they can be reprojected onto any render size. Convert them back to pixels withPerceiveResult.points_to_pixels(width, height) or the standalone helpers in perceptron.pointing.geometry. The Coordinate system concept page walks through the math and usage tips.