Imagem de armazenamento em Django Pós -Processimage em Django Storage

s3_connection = boto3.resource('s3',aws_access_key_id=AWS_ACCESS_KEY_ID,
                                                        aws_secret_access_key= AWS_SECRET_ACCESS_KEY)

img = Image.fromarray(cv_image).convert('RGB')
out_img = BytesIO()
img.save(out_img, format='png')
out_img.seek(0)
s3_connection.Bucket('roofinspectiontestimagesai').put_object(Key=predicted_image_path,Body=out_img,ContentType='image/png',ACL='public-read')
Innocent Ibis