Spaces:
Runtime error
Runtime error
Update app.py
Browse files39 unmodified lines404142434445465 unmodified lines52535455565739 unmodified lines# Process image: Resize and convert to base64img_str = ""if image is not None:image = Image.open(BytesIO(image))# Resize image, maintaining aspect ratio, and max width 1024 pixelsbase_width = 1024w_percent = (base_width / float(image.size[0]))5 unmodified linesimage.save(buffered, format="JPEG")img_str = base64.b64encode(buffered.getvalue()).decode('utf-8')# Prepare data objectobj = Base()obj["image"] = img_str39 unmodified lines4041424344455 unmodified lines5152535455565739 unmodified lines# Process image: Resize and convert to base64img_str = ""if image is not None:# Resize image, maintaining aspect ratio, and max width 1024 pixelsbase_width = 1024w_percent = (base_width / float(image.size[0]))5 unmodified linesimage.save(buffered, format="JPEG")img_str = base64.b64encode(buffered.getvalue()).decode('utf-8')# Prepare data objectobj = Base()obj["image"] = img_str
app.py+1-1