Edamam API and dish volume estimation
This commit is contained in:
+13
-3
@@ -3,8 +3,13 @@ import base64
|
||||
import uuid
|
||||
from flask import Flask, request, jsonify
|
||||
from pymongo import MongoClient
|
||||
from tools.aichat import generate
|
||||
from shared import config
|
||||
from APIs import generate, EdamamAPI
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
try:
|
||||
from shared import config
|
||||
except ImportError:
|
||||
from ..shared import config
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@@ -93,7 +98,12 @@ def device_network():
|
||||
|
||||
except Exception as e:
|
||||
return jsonify({"error": f"Database error: {str(e)}"}), 500
|
||||
|
||||
|
||||
@app.route("/debug", methods=["GET"])
|
||||
def debug():
|
||||
image_path = "microwaveDish.jpg"
|
||||
edamam = EdamamAPI()
|
||||
return edamam.analyze_dish_image(image_path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=config.DEBUG)
|
||||
Reference in New Issue
Block a user