refactoring + execution time

This commit is contained in:
2025-04-25 16:33:01 +02:00
parent 8d0d9c4321
commit f22ea02e59
11 changed files with 55 additions and 51 deletions

View File

@@ -0,0 +1,16 @@
from application import anpr
import io
async def process_image(image: bytes) -> str:
print("Saving file to memory")
image_file = io.BytesIO(image)
print("Processing image")
anpr_info = await anpr.detect(image_file) # type: ignore
if anpr_info is None:
print("Something went wrong with ANPR")
return ""
return str(anpr_info["plate_number"])