ConvertBoundingBoxFormat¶
- class torchvision.transforms.v2.ConvertBoundingBoxFormat(format: Union[str, BoundingBoxFormat])[原始碼]¶
將邊界框座標轉換為給定的
format
,例如從 “CXCYWH” 轉換為 “XYXY”。- 參數:
format (str 或 tv_tensors.BoundingBoxFormat) – 輸出邊界框格式。 可能的值由
BoundingBoxFormat
定義,字串值與 enum 匹配,例如 “XYXY” 或 “XYWH” 等。
- transform(inpt: BoundingBoxes, params: Dict[str, Any]) BoundingBoxes [原始碼]¶
用於覆寫自訂轉換的方法。
請參閱 如何編寫自己的 v2 轉換