seperate yolo results because it updates now only when going to /yolo_results

This commit is contained in:
ishak jmilou.ishak
2025-01-21 16:01:59 +01:00
parent d5524d7890
commit 899aa94b40

View File

@@ -160,7 +160,11 @@ def image():
@app.route('/yolo_results', methods=['GET'])
def yolo_results_endpoint():
global yolo_results
global yolo_results
return jsonify(yolo_results)
def yolo_results_db():
global yolo_results
with lock:
try:
db = get_db()
@@ -175,8 +179,6 @@ def yolo_results_endpoint():
print(f"Database error: {err}")
except Exception as e:
print(f"Unexpected error: {e}")
return jsonify(yolo_results)
if __name__ == '__main__':
app.run(debug=True, port=5000)