Spaces:
Sleeping
Sleeping
Update classifier.py
Browse files- classifier.py +6 -4
classifier.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import matplotlib.pyplot as plt
|
| 2 |
import numpy as np
|
| 3 |
import cv2
|
|
|
|
| 4 |
import streamlit as st
|
| 5 |
import tensorflow as tf
|
| 6 |
from sklearn.metrics import f1_score
|
|
@@ -12,11 +13,12 @@ from tensorflow.keras.models import load_model
|
|
| 12 |
|
| 13 |
# copied_image2 = original_image.copy()
|
| 14 |
#img = cv2.imread('car3.jpg')
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
-
def my_function(
|
| 18 |
-
|
| 19 |
|
|
|
|
| 20 |
|
| 21 |
# Loads the data required for detecting the license plates from cascade classifier.
|
| 22 |
plate_cascade = cv2.CascadeClassifier('indian_license_plate.xml')
|
|
@@ -218,8 +220,8 @@ def run():
|
|
| 218 |
|
| 219 |
# Check if any file is uploaded
|
| 220 |
if uploaded_files:
|
| 221 |
-
for
|
| 222 |
-
st.write("filename:",
|
| 223 |
my_function()
|
| 224 |
# Close the form
|
| 225 |
submitted = st.form_submit_button('Recognize')
|
|
|
|
| 1 |
import matplotlib.pyplot as plt
|
| 2 |
import numpy as np
|
| 3 |
import cv2
|
| 4 |
+
from PIL import Image
|
| 5 |
import streamlit as st
|
| 6 |
import tensorflow as tf
|
| 7 |
from sklearn.metrics import f1_score
|
|
|
|
| 13 |
|
| 14 |
# copied_image2 = original_image.copy()
|
| 15 |
#img = cv2.imread('car3.jpg')
|
| 16 |
+
from PIL import Image
|
| 17 |
|
| 18 |
|
| 19 |
+
def my_function(uploaded_file):
|
|
|
|
| 20 |
|
| 21 |
+
img = uploaded_file.copy()
|
| 22 |
|
| 23 |
# Loads the data required for detecting the license plates from cascade classifier.
|
| 24 |
plate_cascade = cv2.CascadeClassifier('indian_license_plate.xml')
|
|
|
|
| 220 |
|
| 221 |
# Check if any file is uploaded
|
| 222 |
if uploaded_files:
|
| 223 |
+
for uploaded_file in uploaded_files:
|
| 224 |
+
st.write("filename:", uploaded_file.name)
|
| 225 |
my_function()
|
| 226 |
# Close the form
|
| 227 |
submitted = st.form_submit_button('Recognize')
|