Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ max_len = 10
|
|
9 |
def ocr(plate_image, ocr_model):
|
10 |
try:
|
11 |
if 'yolo' in ocr_model:
|
12 |
-
|
13 |
-
model = YOLO(f'./weights/best.pt', task='detect')
|
14 |
preds = model.predict(plate_image)
|
15 |
pred_data = [list(pred.boxes.data.cpu().numpy()[0]) for pred in preds[0]]
|
16 |
x_sorted_preds = sorted(pred_data, key=lambda x:x[0])
|
|
|
9 |
def ocr(plate_image, ocr_model):
|
10 |
try:
|
11 |
if 'yolo' in ocr_model:
|
12 |
+
model = YOLO(f'./weights/{ocr_model}.pt', task='detect')
|
13 |
+
# model = YOLO(f'./weights/best.pt', task='detect')
|
14 |
preds = model.predict(plate_image)
|
15 |
pred_data = [list(pred.boxes.data.cpu().numpy()[0]) for pred in preds[0]]
|
16 |
x_sorted_preds = sorted(pred_data, key=lambda x:x[0])
|