From d7474a11abcd74559759f42fec67fce2b1439adb Mon Sep 17 00:00:00 2001 From: Nandhini Anand Jeyahar Date: Thu, 1 May 2025 20:42:34 +0200 Subject: [PATCH] better logging and moved BASE_PATH to consts.py --- .gitignore | 1 + anpr_main.py | 11 +++++------ db/numberplates.sqlite3 | Bin 20480 -> 20480 bytes lib/anpr.py | 5 ++--- lib/consts.py | 3 ++- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index ac41faf..e4bec62 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ videos/* data/* +logs/* diff --git a/anpr_main.py b/anpr_main.py index 008658b..f1f7e47 100644 --- a/anpr_main.py +++ b/anpr_main.py @@ -3,7 +3,7 @@ #* File Name : anpr_yolo_v8.py #* Purpose : #* Creation Date : 21-04-2025 -#* Last Modified : Thu 01 May 2025 05:48:26 PM UTC +#* Last Modified : Thu 01 May 2025 08:27:26 PM CEST #* Created By : Yaay Nands #_._._._._._._._._._._._._._._._._._._._._.# import glob @@ -235,12 +235,11 @@ async def capture_number_plate(db, signal_received): res = await cursor.fetchall() logger.debug("found unprocessed records: %i ", len(res)) for record in res: - #logger.debug("processing record: %s"%json.dumps(record)) - plates = anprm.infer(filename) + logger.debug("processing video file %s"%record['filename']) + plates = anprm.infer(record['filename']) cursor = await db.execute(SQL["UPDATE_NUMBERS"], - (True, 'NOMARS', record['model'], - record['filename'], - record['ts'])) + (True, json.dumps(plates), record['model'], + record['filename'], record['ts'])) res = await cursor.fetchone() except asyncio.CancelledError: logger.debug("Closing loop capture_number_plate") diff --git a/db/numberplates.sqlite3 b/db/numberplates.sqlite3 index 2683eb88aa49fbcc3de3aa36c15d6c67482598a6..5fec6d00e0703c9aad4014b8a116660fc076bc3d 100644 GIT binary patch delta 154 zcmZozz}T>Wae_1>$3z)tRt^Tevd)bui}+bKG4OBNEGV#o-^_=RO|(##gCQ}mph!O> zKQ~oBFEKBrSid~KD7&~IF*#K~*`!z>EL)bDl9~@>=j7;5ejzW%a*Bcf6wr_Z{CcL$ Og`C7|-uy$KLjeHw6EnsD delta 70 zcmV-M0J;BwpaFoO0gxL30+Ad;1p)vrV*#;bq7MYz01w==5irsZ3?cyr6&)=I0AX%$ ca+ByE9t89N5A?GUK tuple[float, float, float, float]: diff --git a/lib/consts.py b/lib/consts.py index b99b5c7..1cfbbf1 100644 --- a/lib/consts.py +++ b/lib/consts.py @@ -2,7 +2,8 @@ DB_RECORDINGS = "db/numberplates.sqlite3" VIDEO_OUT_FULL = "videos/full/" VIDEO_OUT_ANAL = "videos/analysis" -MODEL_NAME = "models/train25/best.pt" +BASE_PATH = '/home/nands/workspace/c4s/anpr' +MODEL_NAME = "yolo_v8_custom" RTSP_URL = "rtsp://admin:C4sinfra12@192.168.1.10:554/rtsp" SCREEN_RESOLUTION = (1280, 720) # Resolution of the RTSP stream BITRATE = 1000000 # Bitrate for video recording