def resize_to_cell_size(the_ragion, interpolation = cv2.INTER_AREA): # the_ragion.shape.pl() heighted_ragion = Image.resize_keeping_ratio_by_fixed_length(the_ragion, IMG_SIZE, interpolation) # heighted_ragion.shape.pl() standard_ragion = Ragion.fill(heighted_ragion,(IMG_SIZE,IMG_SIZE)) # standard_ragion.shape.pl() return standard_ragion