Spaces:
Runtime error
Runtime error
| import cv2 | |
| import gradio as gr | |
| from main import read_number_plate, add_text, add_rect | |
| from detection import resize | |
| def predict_fn(im): | |
| im = resize(im) | |
| boxes, texts = read_number_plate(im) | |
| print(texts) | |
| for box, text in zip(boxes, texts): | |
| im = add_rect(im, *box) | |
| im = add_text(im, text, box) | |
| return im | |
| demo = gr.Interface( | |
| fn=predict_fn, | |
| inputs=[gr.inputs.Image(label="Input Image")], | |
| outputs=[gr.inputs.Image(label="Prediction")], | |
| title="Automatic Number Plate Recognition Demo", | |
| description="Gradio App for Automatic Number Plate Recognition", | |
| examples=[ | |
| ["example/car1.jpg"], | |
| ["example/car2.jpg"], | |
| ["example/car3.jpg"] | |
| ], | |
| ) | |
| demo.launch() |