File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -669,6 +669,13 @@ def parse_args(input_args=None):
669669 ),
670670 )
671671
672+ parser .add_argument (
673+ "--image_interpolation_mode" ,
674+ type = str ,
675+ default = "lanczos" ,
676+ help = "The image interpolation method to use for resizing images." ,
677+ )
678+
672679 if input_args is not None :
673680 args = parser .parse_args (input_args )
674681 else :
@@ -790,7 +797,12 @@ def __init__(
790797 self .original_sizes = []
791798 self .crop_top_lefts = []
792799 self .pixel_values = []
793- train_resize = transforms .Resize (size , interpolation = transforms .InterpolationMode .BILINEAR )
800+
801+ if args .image_interpolation_mode == "bilinear" :
802+ train_resize = transforms .Resize (size , interpolation = transforms .InterpolationMode .BILINEAR )
803+ else :
804+ train_resize = transforms .Resize (size , interpolation = transforms .InterpolationMode .LANCZOS )
805+
794806 train_crop = transforms .CenterCrop (size ) if center_crop else transforms .RandomCrop (size )
795807 train_flip = transforms .RandomHorizontalFlip (p = 1.0 )
796808 train_transforms = transforms .Compose (
You can’t perform that action at this time.
0 commit comments