code: def process(image, size, *args, **kwargs):
          
          from autodetect import smart_crop
          box_width, box_height = AutoCrop.parse_size(image, size)
          scaled_size, rect = smart_crop(box_width, box_height, image.filename)
          return image.resize(scaled_size, Image.ANTIALIAS).crop(tuple(rect))
docs: Automatically crop the image based on image gravity and face detection