From 36aaee9bad12fa62b9cb4132f33f8c68bf799587 Mon Sep 17 00:00:00 2001 From: "ishak jmilou.ishak" Date: Thu, 16 Jan 2025 12:15:14 +0100 Subject: [PATCH] removed commented code --- src/Python/flask/web/app.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/Python/flask/web/app.py b/src/Python/flask/web/app.py index 6784acc..6f89d0d 100644 --- a/src/Python/flask/web/app.py +++ b/src/Python/flask/web/app.py @@ -48,7 +48,6 @@ def on_message(client, userdata, message): x1, y1, x2, y2 = map(int, box.xyxy[0]) cv2.rectangle(processed_image, (x1, y1), (x2, y2), (0, 255, 0), 2) cv2.putText(processed_image, f"{class_name} {box.conf.item():.2f}", (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (0, 255, 0), 2) - # yolo_results_db() # Create an MQTT client instance mqtt_client = mqtt.Client() @@ -163,7 +162,6 @@ def image(): def yolo_results_endpoint(): global yolo_results with lock: - print(f"YOLO Results: {yolo_results}") # Debug statement db = get_db() with db.cursor() as cursor: sql_yolo = "INSERT INTO image (class, confidence) VALUES (%s, %s)" @@ -174,17 +172,6 @@ def yolo_results_endpoint(): cursor.close() return jsonify(yolo_results) -# def yolo_results_db(): -# global yolo_results -# with lock: -# db = get_db() -# with db.cursor() as cursor: -# sql_yolo = "INSERT INTO image (object, confidence) VALUES (%s, %s)" -# yolo_tuples = [(result["class"], result["confidence"]) for result in yolo_results] -# cursor.executemany(sql_yolo, yolo_tuples) -# db.commit() -# cursor.close() - if __name__ == '__main__': app.run(debug=True, port=5000) \ No newline at end of file