Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,8 +13,8 @@ from PIL import Image, ImageDraw, ImageFont, ImageOps
|
|
| 13 |
st.title("Lector de Matrículas")
|
| 14 |
|
| 15 |
#subtitle
|
| 16 |
-
st.markdown("## Lector de Matrículas - `YoloV5`, `EasyOCR`")
|
| 17 |
-
|
| 18 |
#image uploader
|
| 19 |
image = st.file_uploader(label="",type=['png','jpg','jpeg'])
|
| 20 |
|
|
@@ -42,7 +42,7 @@ def detect(img, reader, plate_detector):
|
|
| 42 |
plate.sort(key=len, reverse = True)
|
| 43 |
plate = ''.join(plate)[:7].upper()
|
| 44 |
|
| 45 |
-
|
| 46 |
img = Image.fromarray(img)
|
| 47 |
I = ImageDraw.Draw(img)
|
| 48 |
myFont = ImageFont.truetype('MESPREG.ttf', 300)
|
|
@@ -63,7 +63,6 @@ if image is not None:
|
|
| 63 |
input_image = input_image = Image.open(image) #read image
|
| 64 |
input_image = ImageOps.exif_transpose(input_image)
|
| 65 |
input_image = np.array(input_image )
|
| 66 |
-
# Convert RGB to BGR
|
| 67 |
input_image = input_image[:, :, ::-1].copy()
|
| 68 |
|
| 69 |
|
|
|
|
| 13 |
st.title("Lector de Matrículas")
|
| 14 |
|
| 15 |
#subtitle
|
| 16 |
+
st.markdown("## Lector de Matrículas - `YoloV5`, `EasyOCR` - 🚘")
|
| 17 |
+
|
| 18 |
#image uploader
|
| 19 |
image = st.file_uploader(label="",type=['png','jpg','jpeg'])
|
| 20 |
|
|
|
|
| 42 |
plate.sort(key=len, reverse = True)
|
| 43 |
plate = ''.join(plate)[:7].upper()
|
| 44 |
|
| 45 |
+
|
| 46 |
img = Image.fromarray(img)
|
| 47 |
I = ImageDraw.Draw(img)
|
| 48 |
myFont = ImageFont.truetype('MESPREG.ttf', 300)
|
|
|
|
| 63 |
input_image = input_image = Image.open(image) #read image
|
| 64 |
input_image = ImageOps.exif_transpose(input_image)
|
| 65 |
input_image = np.array(input_image )
|
|
|
|
| 66 |
input_image = input_image[:, :, ::-1].copy()
|
| 67 |
|
| 68 |
|