ConvertBoundingBoxFormat¶
- class torchvision.transforms.v2.ConvertBoundingBoxFormat(format: Union[str, BoundingBoxFormat])[source]¶
将边界框坐标转换为指定的
format
,例如从“CXCYWH”转换为“XYXY”。- 参数:
format (str 或 tv_tensors.BoundingBoxFormat) – 输出边界框格式。可能的值由
BoundingBoxFormat
定义,字符串值匹配枚举,例如“XYXY”或“XYWH”等。
- transform(inpt: BoundingBoxes, params: dict[str, Any]) BoundingBoxes [source]¶
用于覆盖自定义变换的方法。
请参阅 如何编写自己的 v2 变换