Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import zxingcpp
|
| 3 |
+
|
| 4 |
+
def decode(im):
|
| 5 |
+
img = cv2.imread(f'{im}')
|
| 6 |
+
results = zxingcpp.read_barcodes(img)
|
| 7 |
+
|
| 8 |
+
print (results[0].text)
|
| 9 |
+
return results[0].text
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
with gr.Blocks() as app:
|
| 14 |
+
in_im = gr.Image("QR Image to Decode")
|
| 15 |
+
dec_btn = gr.Button("Decode QR")
|
| 16 |
+
text_out = gr.Textbox("Decoded Text")
|
| 17 |
+
|
| 18 |
+
dec_btn.click(decode,in_im,text_out)
|
| 19 |
+
app.queue(concurrency_count=10).launch()
|