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