@@ -237,7 +237,7 @@ def _execute(self, augmentor_image, save_to_disk=True, multi_threaded=True):
237237
238238 if save_to_disk :
239239 filename , ext = os .path .splitext (os .path .basename (augmentor_image .image_path ))
240- file_name = "{}_{}.{} " .format (filename , str (uuid .uuid4 ()), self . save_format )
240+ file_name = "{}_{}" .format (filename , str (uuid .uuid4 ()). replace ( "-" , "" ) )
241241 try :
242242 for i in range (len (images )):
243243 if i == 0 :
@@ -248,7 +248,7 @@ def _execute(self, augmentor_image, save_to_disk=True, multi_threaded=True):
248248 + file_name \
249249 + "." \
250250 + (self .save_format if self .save_format else augmentor_image .file_format )
251-
251+ save_name = "{}.{}" . format ( file_name , self . save_format )
252252 images [i ].save (os .path .join (augmentor_image .output_directory , save_name ))
253253
254254 else :
@@ -262,7 +262,7 @@ def _execute(self, augmentor_image, save_to_disk=True, multi_threaded=True):
262262 + file_name \
263263 + "." \
264264 + (self .save_format if self .save_format else augmentor_image .file_format )
265-
265+ save_name = "{}_gt.{}" . format ( file_name , self . save_format )
266266 images [i ].save (os .path .join (augmentor_image .output_directory , save_name ))
267267
268268 except IOError as e :
@@ -1191,6 +1191,36 @@ def zoom(self, probability, min_factor, max_factor):
11911191 else :
11921192 self .add_operation (Zoom (probability = probability , min_factor = min_factor , max_factor = max_factor ))
11931193
1194+ def zoomout (self , probability , min_factor , max_factor ):
1195+ """
1196+ Zoom in to an image, while **maintaining its size**. The amount by
1197+ which the image is zoomed is a randomly chosen value between
1198+ :attr:`min_factor` and :attr:`max_factor`.
1199+
1200+ Typical values may be ``min_factor=1.1`` and ``max_factor=1.5``.
1201+
1202+ To zoom by a constant amount, set :attr:`min_factor` and
1203+ :attr:`max_factor` to the same value.
1204+
1205+ .. seealso:: See :func:`zoom_random` for zooming into random areas
1206+ of the image.
1207+
1208+ :param probability: A value between 0 and 1 representing the
1209+ probability that the operation should be performed.
1210+ :param min_factor: The minimum factor by which to zoom the image.
1211+ :param max_factor: The maximum factor by which to zoom the image.
1212+ :type probability: Float
1213+ :type min_factor: Float
1214+ :type max_factor: Float
1215+ :return: None
1216+ """
1217+ if not 0 < probability <= 1 :
1218+ raise ValueError (Pipeline ._probability_error_text )
1219+ elif (min_factor <= 1 ) or (max_factor <= 1 ):
1220+ raise ValueError ("The min_factor or max_factor argument must be greater than 1." )
1221+ else :
1222+ self .add_operation (ZoomOut (probability = probability , min_factor = min_factor , max_factor = max_factor ))
1223+
11941224 def zoom_random (self , probability , percentage_area , randomise_percentage_area = False ):
11951225 """
11961226 Zooms into an image at a random location within the image.
0 commit comments