@@ -449,37 +449,6 @@ def test__get_params(self, fill, side_range):
449
449
assert 0 <= params ["padding" ][3 ] <= (side_range [1 ] - 1 ) * h
450
450
451
451
452
- class TestGaussianBlur :
453
- def test_assertions (self ):
454
- with pytest .raises (ValueError , match = "Kernel size should be a tuple/list of two integers" ):
455
- transforms .GaussianBlur ([10 , 12 , 14 ])
456
-
457
- with pytest .raises (ValueError , match = "Kernel size value should be an odd and positive number" ):
458
- transforms .GaussianBlur (4 )
459
-
460
- with pytest .raises (
461
- TypeError , match = "sigma should be a single int or float or a list/tuple with length 2 floats."
462
- ):
463
- transforms .GaussianBlur (3 , sigma = [1 , 2 , 3 ])
464
-
465
- with pytest .raises (ValueError , match = "If sigma is a single number, it must be positive" ):
466
- transforms .GaussianBlur (3 , sigma = - 1.0 )
467
-
468
- with pytest .raises (ValueError , match = "sigma values should be positive and of the form" ):
469
- transforms .GaussianBlur (3 , sigma = [2.0 , 1.0 ])
470
-
471
- @pytest .mark .parametrize ("sigma" , [10.0 , [10.0 , 12.0 ]])
472
- def test__get_params (self , sigma ):
473
- transform = transforms .GaussianBlur (3 , sigma = sigma )
474
- params = transform ._get_params ([])
475
-
476
- if isinstance (sigma , float ):
477
- assert params ["sigma" ][0 ] == params ["sigma" ][1 ] == 10
478
- else :
479
- assert sigma [0 ] <= params ["sigma" ][0 ] <= sigma [1 ]
480
- assert sigma [0 ] <= params ["sigma" ][1 ] <= sigma [1 ]
481
-
482
-
483
452
class TestRandomPerspective :
484
453
def test_assertions (self ):
485
454
with pytest .raises (ValueError , match = "Argument distortion_scale value should be between 0 and 1" ):
@@ -503,24 +472,18 @@ def test__get_params(self):
503
472
class TestElasticTransform :
504
473
def test_assertions (self ):
505
474
506
- with pytest .raises (TypeError , match = "alpha should be float or a sequence of floats " ):
475
+ with pytest .raises (TypeError , match = "alpha should be a number or a sequence of numbers " ):
507
476
transforms .ElasticTransform ({})
508
477
509
- with pytest .raises (ValueError , match = "alpha is a sequence its length should be one of 2" ):
478
+ with pytest .raises (ValueError , match = "alpha is a sequence its length should be 1 or 2" ):
510
479
transforms .ElasticTransform ([1.0 , 2.0 , 3.0 ])
511
480
512
- with pytest .raises (ValueError , match = "alpha should be a sequence of floats" ):
513
- transforms .ElasticTransform ([1 , 2 ])
514
-
515
- with pytest .raises (TypeError , match = "sigma should be float or a sequence of floats" ):
481
+ with pytest .raises (TypeError , match = "sigma should be a number or a sequence of numbers" ):
516
482
transforms .ElasticTransform (1.0 , {})
517
483
518
- with pytest .raises (ValueError , match = "sigma is a sequence its length should be one of 2" ):
484
+ with pytest .raises (ValueError , match = "sigma is a sequence its length should be 1 or 2" ):
519
485
transforms .ElasticTransform (1.0 , [1.0 , 2.0 , 3.0 ])
520
486
521
- with pytest .raises (ValueError , match = "sigma should be a sequence of floats" ):
522
- transforms .ElasticTransform (1.0 , [1 , 2 ])
523
-
524
487
with pytest .raises (TypeError , match = "Got inappropriate fill arg" ):
525
488
transforms .ElasticTransform (1.0 , 2.0 , fill = "abc" )
526
489
0 commit comments