Update main.py

This commit is contained in:
Guilherme Werner
2023-10-10 21:09:39 -03:00
parent 32be4782f7
commit 330a5610d4

View File

@ -51,9 +51,6 @@ def caption_image():
@app.route('/caption-base64', methods=['POST'])
def caption_image_base64():
data = request.get_json()
print(data)
if 'image_base64' in data:
image_base64 = re.sub('^data:image/.+;base64,', '', data['image_base64'])
image_data = base64.b64decode(image_base64)
@ -65,7 +62,5 @@ def caption_image_base64():
else:
return jsonify({"error": "Missing 'image_base64'"}), 400
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5885, debug=True)