From b21b24cc175c70b67bf7446b4e92efd69e4ef6b7 Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Wed, 17 Jul 2024 21:14:01 +0200 Subject: [PATCH] added nice webui on / --- alpr_api.py | 6 ++- static/logo.webp | Bin 0 -> 3244 bytes static/styles.css | 25 ++++++++++++ templates/index.html | 93 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 static/logo.webp create mode 100644 static/styles.css create mode 100644 templates/index.html diff --git a/alpr_api.py b/alpr_api.py index 4818f42..8a07908 100644 --- a/alpr_api.py +++ b/alpr_api.py @@ -6,7 +6,7 @@ from time import sleep import ultimateAlprSdk from PIL import Image -from flask import Flask, request, jsonify +from flask import Flask, request, jsonify, render_template counter = 0 @@ -141,6 +141,10 @@ def create_rest_server_flask(): else: return jsonify({'error': 'Endpoint not implemented'}), 404 + @app.route('/') + def index(): + return render_template('index.html') + return app diff --git a/static/logo.webp b/static/logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..00c2116c14f887e9094e762d808d2215b3d62739 GIT binary patch literal 3244 zcmV;d3{&$`Nk&Gb3;+OEMM6+kP&il$0000G0001w0RUwH06|PpNR|Zv00FQAZJQg} z%2zkK)p2JR5FUhwKc0-LDN^BK;wGaMFOd@-ga_fhpL}D*jR)aD#KJ^_hc{5GXS6$K z_FNwk6QC#k|D^w)nDQokE#A)SP~M*^CvI=__oKqdZ63n?r;=NKDDOETgm5N&2*KZw zGK6ps;nt7-UITC@46qv#fO|){eb{}b_6&6Qnc@>iGmA0Cx;&z=HpaNOBCDukjIk;b zg_-#rZ)ScSZ*`0@nm^90je9efQCJ&e+?!j^Ssi1Ht)0ZoyyR>jV{9#_G&3hzjIp{< zd?bC?ml;KzNKchpYA2FY>m+r+b_g?wagy znyUkub=G#|a=AJHLuYmOBj6BHJ<#vWteJo&aRtzK-2||av0-D zG4H!+#!k`zQ@1m-W&*C(C?*)Xt=X;v#_|;71hD^8f;MO3aw$ikD^K!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<8SQm{^o5bOS8;l*F1E=rQx&79etHdey zq*r`F68*$-0(5P~DDiAJZT?(k`H*o;vL&%CepRN3>OS5B8stSdaW{E!yoz0cdPHE< z4kw?#O6^F9k4|y=P-?O588Bi481N)*{Zm1?F{kT_=^*Vk6B@Fg^5+U^s$X4*;d-M( zx?1TP@DQ0c4E1D~XnNuJ;h3bx*Bxfn+R*M@EK&>ur-Yv~mE&ADRmKc*)^4Suad@gP zsKgMXZ8&mJ$G0w3|JkR5IS0HXCAWXqmt;7p{*D=!G%66!7lGd4)!3w}Jrs)WwbC!& z2V0w03|JPJhgjS+?8r)A8uz}&Hj75q>_J`pr1uy1U5sp{DaS)Gx8d9A{z`t5U*h}!?NP1ga`$Q$9JgkPcKP^q2WlYCqDs&>_=*hdoNU=t={asD efh1-%NzCRTv}s6u;eY*@-_{@h%@_ax0000uhE2Kv literal 0 HcmV?d00001 diff --git a/static/styles.css b/static/styles.css new file mode 100644 index 0000000..686cd2c --- /dev/null +++ b/static/styles.css @@ -0,0 +1,25 @@ +body { + font-family: 'Arial', sans-serif; + background-color: #f4f4f9; + margin: 0; + padding: 0; +} + +.container { + background: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); + max-width: 600px; + margin: auto; +} + +h1, h2 { + color: #333; +} + +pre { + background-color: #f8f9fa; + border: 1px solid #ddd; + border-radius: 5px; +} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..926f7ab --- /dev/null +++ b/templates/index.html @@ -0,0 +1,93 @@ + + + + + + Image Upload + + + + + + + +
+ Logo +
+ +
+

Upload Image for ALPR

+
+
+ +
+ + + +
+
+ + +
+
+

Response

+

+        
+
+ + + + +