Add angle to BoundingBox
PiperOrigin-RevId: 547321781
This commit is contained in:
parent
aabf61f28d
commit
f2f49b9fc8
|
@ -24,4 +24,10 @@ export declare interface BoundingBox {
|
|||
width: number;
|
||||
/** The height of the bounding box, in pixels. */
|
||||
height: number;
|
||||
/**
|
||||
* Angle of rotation of the original non-rotated box around the top left
|
||||
* corner of the original non-rotated box, in clockwise degrees from the
|
||||
* horizontal.
|
||||
*/
|
||||
angle: number;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ describe('convertFromDetectionProto()', () => {
|
|||
categoryName: 'foo',
|
||||
displayName: 'bar',
|
||||
}],
|
||||
boundingBox: {originX: 1, originY: 2, width: 3, height: 4},
|
||||
boundingBox: {originX: 1, originY: 2, width: 3, height: 4, angle: 0},
|
||||
keypoints: [{
|
||||
x: 5,
|
||||
y: 6,
|
||||
|
@ -85,7 +85,7 @@ describe('convertFromDetectionProto()', () => {
|
|||
categoryName: '',
|
||||
displayName: '',
|
||||
}],
|
||||
boundingBox: {originX: 0, originY: 0, width: 0, height: 0},
|
||||
boundingBox: {originX: 0, originY: 0, width: 0, height: 0, angle: 0},
|
||||
keypoints: []
|
||||
});
|
||||
});
|
||||
|
|
|
@ -42,7 +42,8 @@ export function convertFromDetectionProto(source: DetectionProto): Detection {
|
|||
originX: boundingBox.getXmin() ?? 0,
|
||||
originY: boundingBox.getYmin() ?? 0,
|
||||
width: boundingBox.getWidth() ?? 0,
|
||||
height: boundingBox.getHeight() ?? 0
|
||||
height: boundingBox.getHeight() ?? 0,
|
||||
angle: 0.0,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ describe('FaceDetector', () => {
|
|||
categoryName: '',
|
||||
displayName: '',
|
||||
}],
|
||||
boundingBox: {originX: 0, originY: 0, width: 0, height: 0},
|
||||
boundingBox: {originX: 0, originY: 0, width: 0, height: 0, angle: 0},
|
||||
keypoints: []
|
||||
});
|
||||
});
|
||||
|
|
|
@ -210,7 +210,7 @@ describe('ObjectDetector', () => {
|
|||
categoryName: '',
|
||||
displayName: '',
|
||||
}],
|
||||
boundingBox: {originX: 0, originY: 0, width: 0, height: 0},
|
||||
boundingBox: {originX: 0, originY: 0, width: 0, height: 0, angle: 0},
|
||||
keypoints: []
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user