Speichern Sie das Bild in Django postProcessimage im Django -Speicher

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