BUNCH OF TRASH

This commit is contained in:
2025-04-24 18:17:26 +02:00
parent 9576899d1a
commit 8fb271ee72
16 changed files with 39 additions and 50 deletions

View File

@@ -24,21 +24,15 @@ def home():
return "Hello, World!"
i = 0
# API to process vehicle
@app.route("/api", methods=["POST"])
def data():
data = request.data
global i
with open(f"image{i}.jpg", "wb") as f:
with open("image.jpg", "wb") as f:
f.write(data)
status = asyncio.run(process_image(f"image{i}.jpg"))
i += 1
status = asyncio.run(process_image("image.jpg"))
return jsonify(
{
"message": "Image sent succesfully",
@@ -48,8 +42,9 @@ def data():
async def process_image(file: str) -> bool:
print("Processing image")
anpr = ANPR()
anpr_info: ... = await anpr.detect(file) # type: ignore
anpr_info = await anpr.detect(file) # type: ignore
number_plate = anpr_info["plate_number"]
if number_plate:
allowed = (