better logging and moved BASE_PATH to consts.py
This commit is contained in:
parent
fe515d61ba
commit
d7474a11ab
5 changed files with 10 additions and 10 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
videos/*
|
||||
data/*
|
||||
logs/*
|
||||
|
|
|
|||
11
anpr_main.py
11
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")
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -6,16 +6,15 @@ import torch
|
|||
import ultralytics
|
||||
from ultralytics import YOLO
|
||||
from PIL import Image
|
||||
ultralytics.checks()
|
||||
#ultralytics.checks()
|
||||
from xml.etree import ElementTree as ET
|
||||
|
||||
from .consts import BASE_PATH
|
||||
|
||||
if torch.cuda.is_available():
|
||||
device = torch.device('cuda')
|
||||
else:
|
||||
device = torch.device('cpu')
|
||||
|
||||
BASE_PATH = '..'
|
||||
def convert_bbox_to_yolo(
|
||||
size: tuple[float, float], box: tuple[float, float, float, float]
|
||||
) -> tuple[float, float, float, float]:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue