mirror of
https://github.com/StefBuwalda/ProjectIOT.git
synced 2025-10-30 03:09:58 +00:00
Werkend ANPR systeem
This commit is contained in:
@@ -2,9 +2,14 @@ from flask import Flask
|
||||
from flask_migrate import Migrate
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_login import LoginManager
|
||||
from io import BytesIO
|
||||
|
||||
|
||||
# from authlib.integrations.flask_client import OAuth
|
||||
|
||||
# Memory for last_image
|
||||
last_image = BytesIO()
|
||||
|
||||
# Web Server
|
||||
app = Flask(__name__)
|
||||
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///data.sqlite"
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from flask import Blueprint, request, jsonify
|
||||
from application import db
|
||||
import application
|
||||
from application.dashboard.models import AllowedPlate, LoggedItem
|
||||
from application.api.image_processing import process_image
|
||||
from datetime import datetime
|
||||
import asyncio
|
||||
import io
|
||||
|
||||
api_blueprint = Blueprint("api", __name__, template_folder="templates")
|
||||
|
||||
@@ -12,6 +14,8 @@ api_blueprint = Blueprint("api", __name__, template_folder="templates")
|
||||
@api_blueprint.route("/", methods=["POST"])
|
||||
def data():
|
||||
data = request.data
|
||||
application.last_image.seek(0)
|
||||
application.last_image = io.BytesIO(request.data)
|
||||
np = asyncio.run(process_image(image=data))
|
||||
|
||||
# Check if the found plate is allowed to exit
|
||||
|
||||
Reference in New Issue
Block a user