Spaces:
Sleeping
Sleeping
Update classifier.py
Browse files- classifier.py +6 -5
classifier.py
CHANGED
|
@@ -10,9 +10,11 @@ from tensorflow.keras.preprocessing.image import ImageDataGenerator
|
|
| 10 |
from tensorflow.keras.layers import Dense, Flatten, MaxPooling2D, Dropout, Conv2D
|
| 11 |
from tensorflow.keras.models import load_model
|
| 12 |
|
|
|
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
-
def my_function():
|
| 16 |
|
| 17 |
|
| 18 |
|
|
@@ -46,7 +48,6 @@ def my_function():
|
|
| 46 |
plt.title(title)
|
| 47 |
plt.show()
|
| 48 |
|
| 49 |
-
img = cv2.imread('car3.jpg')
|
| 50 |
|
| 51 |
|
| 52 |
# Getting plate prom the processed image
|
|
@@ -217,15 +218,15 @@ def run():
|
|
| 217 |
|
| 218 |
# Check if any file is uploaded
|
| 219 |
if uploaded_files:
|
| 220 |
-
for
|
| 221 |
-
st.write("filename:",
|
| 222 |
my_function()
|
| 223 |
# Close the form
|
| 224 |
submitted = st.form_submit_button('Recognize')
|
| 225 |
|
| 226 |
|
| 227 |
if submitted:
|
| 228 |
-
my_function()
|
| 229 |
|
| 230 |
|
| 231 |
if __name__ == '__main__':
|
|
|
|
| 10 |
from tensorflow.keras.layers import Dense, Flatten, MaxPooling2D, Dropout, Conv2D
|
| 11 |
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(img):
|
| 18 |
|
| 19 |
|
| 20 |
|
|
|
|
| 48 |
plt.title(title)
|
| 49 |
plt.show()
|
| 50 |
|
|
|
|
| 51 |
|
| 52 |
|
| 53 |
# Getting plate prom the processed image
|
|
|
|
| 218 |
|
| 219 |
# Check if any file is uploaded
|
| 220 |
if uploaded_files:
|
| 221 |
+
for img in uploaded_files:
|
| 222 |
+
st.write("filename:", img.name)
|
| 223 |
my_function()
|
| 224 |
# Close the form
|
| 225 |
submitted = st.form_submit_button('Recognize')
|
| 226 |
|
| 227 |
|
| 228 |
if submitted:
|
| 229 |
+
my_function(img)
|
| 230 |
|
| 231 |
|
| 232 |
if __name__ == '__main__':
|