@@ -275,7 +275,7 @@ def test_common(self, transform, adapter, container_type, image_or_video, device
275275                boxes = datapoints .BoundingBox ([[0 , 0 , 0 , 0 ]], format = format , spatial_size = (224 , 244 )),
276276                labels = torch .tensor ([3 ]),
277277            )
278-             assert  transforms .SanitizeBoundingBoxes ()(sample )["boxes" ].shape  ==  (0 , 4 )
278+             assert  transforms .SanitizeBoundingBox ()(sample )["boxes" ].shape  ==  (0 , 4 )
279279
280280    @parametrize ( 
281281        [ 
@@ -1876,7 +1876,7 @@ def test_detection_preset(image_type, data_augmentation, to_tensor, sanitize):
18761876            transforms .ConvertImageDtype (torch .float ),
18771877        ]
18781878    if  sanitize :
1879-         t  +=  [transforms .SanitizeBoundingBoxes ()]
1879+         t  +=  [transforms .SanitizeBoundingBox ()]
18801880    t  =  transforms .Compose (t )
18811881
18821882    num_boxes  =  5 
@@ -1917,7 +1917,7 @@ def test_detection_preset(image_type, data_augmentation, to_tensor, sanitize):
19171917        # ssd and ssdlite contain RandomIoUCrop which may "remove" some bbox. It 
19181918        # doesn't remove them strictly speaking, it just marks some boxes as 
19191919        # degenerate and those boxes will be later removed by 
1920-         # SanitizeBoundingBoxes (), which we add to the pipelines if the sanitize 
1920+         # SanitizeBoundingBox (), which we add to the pipelines if the sanitize 
19211921        # param is True. 
19221922        # Note that the values below are probably specific to the random seed 
19231923        # set above (which is fine). 
@@ -1989,7 +1989,7 @@ def test_sanitize_bounding_boxes(min_size, labels_getter, sample_type):
19891989        img  =  sample .pop ("image" )
19901990        sample  =  (img , sample )
19911991
1992-     out  =  transforms .SanitizeBoundingBoxes (min_size = min_size , labels_getter = labels_getter )(sample )
1992+     out  =  transforms .SanitizeBoundingBox (min_size = min_size , labels_getter = labels_getter )(sample )
19931993
19941994    if  sample_type  is  tuple :
19951995        out_image  =  out [0 ]
@@ -2023,13 +2023,13 @@ def test_sanitize_bounding_boxes_default_heuristic(key, sample_type):
20232023    sample  =  {key : labels , "another_key" : "whatever" }
20242024    if  sample_type  is  tuple :
20252025        sample  =  (None , sample , "whatever_again" )
2026-     assert  transforms .SanitizeBoundingBoxes ._find_labels_default_heuristic (sample ) is  labels 
2026+     assert  transforms .SanitizeBoundingBox ._find_labels_default_heuristic (sample ) is  labels 
20272027
20282028    if  key .lower () !=  "labels" :
20292029        # If "labels" is in the dict (case-insensitive), 
20302030        # it takes precedence over other keys which would otherwise be a match 
20312031        d  =  {key : "something_else" , "labels" : labels }
2032-         assert  transforms .SanitizeBoundingBoxes ._find_labels_default_heuristic (d ) is  labels 
2032+         assert  transforms .SanitizeBoundingBox ._find_labels_default_heuristic (d ) is  labels 
20332033
20342034
20352035def  test_sanitize_bounding_boxes_errors ():
@@ -2041,25 +2041,25 @@ def test_sanitize_bounding_boxes_errors():
20412041    )
20422042
20432043    with  pytest .raises (ValueError , match = "min_size must be >= 1" ):
2044-         transforms .SanitizeBoundingBoxes (min_size = 0 )
2044+         transforms .SanitizeBoundingBox (min_size = 0 )
20452045    with  pytest .raises (ValueError , match = "labels_getter should either be a str" ):
2046-         transforms .SanitizeBoundingBoxes (labels_getter = 12 )
2046+         transforms .SanitizeBoundingBox (labels_getter = 12 )
20472047
20482048    with  pytest .raises (ValueError , match = "Could not infer where the labels are" ):
20492049        bad_labels_key  =  {"bbox" : good_bbox , "BAD_KEY" : torch .arange (good_bbox .shape [0 ])}
2050-         transforms .SanitizeBoundingBoxes ()(bad_labels_key )
2050+         transforms .SanitizeBoundingBox ()(bad_labels_key )
20512051
20522052    with  pytest .raises (ValueError , match = "If labels_getter is a str or 'default'" ):
20532053        not_a_dict  =  (good_bbox , torch .arange (good_bbox .shape [0 ]))
2054-         transforms .SanitizeBoundingBoxes ()(not_a_dict )
2054+         transforms .SanitizeBoundingBox ()(not_a_dict )
20552055
20562056    with  pytest .raises (ValueError , match = "must be a tensor" ):
20572057        not_a_tensor  =  {"bbox" : good_bbox , "labels" : torch .arange (good_bbox .shape [0 ]).tolist ()}
2058-         transforms .SanitizeBoundingBoxes ()(not_a_tensor )
2058+         transforms .SanitizeBoundingBox ()(not_a_tensor )
20592059
20602060    with  pytest .raises (ValueError , match = "Number of boxes" ):
20612061        different_sizes  =  {"bbox" : good_bbox , "labels" : torch .arange (good_bbox .shape [0 ] +  3 )}
2062-         transforms .SanitizeBoundingBoxes ()(different_sizes )
2062+         transforms .SanitizeBoundingBox ()(different_sizes )
20632063
20642064    with  pytest .raises (ValueError , match = "boxes must be of shape" ):
20652065        bad_bbox  =  datapoints .BoundingBox (  # batch with 2 elements 
@@ -2071,7 +2071,7 @@ def test_sanitize_bounding_boxes_errors():
20712071            spatial_size = (20 , 20 ),
20722072        )
20732073        different_sizes  =  {"bbox" : bad_bbox , "labels" : torch .arange (bad_bbox .shape [0 ])}
2074-         transforms .SanitizeBoundingBoxes ()(different_sizes )
2074+         transforms .SanitizeBoundingBox ()(different_sizes )
20752075
20762076
20772077@pytest .mark .parametrize ( 
0 commit comments