mirror of
				https://github.com/StefBuwalda/ProjectIOT.git
				synced 2025-10-29 18:59:57 +00:00 
			
		
		
		
	Removed old ANPR system
This commit is contained in:
		| @@ -1,7 +1,6 @@ | ||||
| from flask import Flask | ||||
| from flask_migrate import Migrate | ||||
| from flask_sqlalchemy import SQLAlchemy | ||||
| from pyplatex import ANPR  # type: ignore | ||||
| from authlib.integrations.flask_client import OAuth | ||||
|  | ||||
| # Web Server | ||||
| @@ -16,9 +15,6 @@ db = SQLAlchemy(app) | ||||
|  | ||||
| migrate = Migrate(app, db) | ||||
|  | ||||
| # ANPR instance | ||||
| anpr = ANPR() | ||||
|  | ||||
| # Keycloak | ||||
| oauth = OAuth(app=app) | ||||
| url = "http://192.168.69.1:8180" | ||||
|   | ||||
| @@ -1,4 +1,3 @@ | ||||
| from application import anpr | ||||
| import io | ||||
|  | ||||
|  | ||||
| @@ -7,14 +6,14 @@ async def process_image(image: bytes) -> str: | ||||
|     image_file = io.BytesIO(image) | ||||
|  | ||||
|     print("Processing image") | ||||
|     anpr_info = await anpr.detect(image_file)  # type: ignore | ||||
|     # anpr_info = await anpr.detect(image_file)  # type: ignore | ||||
|  | ||||
|     if anpr_info is None: | ||||
|         print("Something went wrong with ANPR") | ||||
|         return "" | ||||
|     # if anpr_info is None: | ||||
|     #    print("Something went wrong with ANPR") | ||||
|     #    return "" | ||||
|  | ||||
|     if not anpr_info["is_plate"]: | ||||
|         return "" | ||||
|     # if not anpr_info["is_plate"]: | ||||
|     #     return "" | ||||
|  | ||||
|     print(anpr_info["plate_number"]) | ||||
|     return str(anpr_info["plate_number"]) | ||||
|     # print(anpr_info["plate_number"]) | ||||
|     return ""  # str(anpr_info["plate_number"]) | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| from flask_wtf import FlaskForm | ||||
| from wtforms.validators import DataRequired | ||||
| from wtforms import StringField, SubmitField | ||||
| from application import db  | ||||
|  | ||||
|  | ||||
| class npForm(FlaskForm): | ||||
|     numberplate = StringField('add a numberplate', validators=[DataRequired()]) | ||||
|     submit = SubmitField('Submit') | ||||
|     numberplate = StringField("add a numberplate", validators=[DataRequired()]) | ||||
|     submit = SubmitField("Submit") | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| from flask import Blueprint, render_template, request, jsonify | ||||
| from flask_login import login_required | ||||
| from application.dashboard.models import AllowedPlate, LoggedItem | ||||
| from application import db, app | ||||
| from application import db | ||||
| from application.dashboard.forms import npForm | ||||
|  | ||||
| dash_blueprint = Blueprint("dash", __name__, template_folder="templates") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user