Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -95,7 +95,8 @@ def FINAL(img) :
|
|
95 |
result is digits and char on car plate.
|
96 |
'''
|
97 |
# Read car image ( STEP-1 )
|
98 |
-
img = cv2.imread(img)
|
|
|
99 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
100 |
|
101 |
# First prediction -> Detect car-plate ( STEP-2 )
|
@@ -122,18 +123,11 @@ if selected_type == "Upload Image":
|
|
122 |
st.info('β¨ Supports all popular image formats π· - PNG, JPG, BMP π')
|
123 |
uploaded_file = st.file_uploader("Upload Image of car's number plate π", type=["png","jpg","bmp","jpeg"])
|
124 |
|
125 |
-
image = np.array(Image.open(uploaded_file))
|
126 |
-
|
127 |
if uploaded_file is not None:
|
128 |
|
129 |
-
image =
|
130 |
-
#image = Image.open(uploaded_file).convert('RGB')
|
131 |
st.image(image, use_column_width=True)
|
132 |
|
133 |
-
#img = io.BytesIO(image)
|
134 |
-
#img = cv2.imdecode(image, cv2.IMREAD_COLOR)
|
135 |
-
|
136 |
-
|
137 |
with st.spinner(f"Working... π«"):
|
138 |
result = FINAL(image)
|
139 |
|
|
|
95 |
result is digits and char on car plate.
|
96 |
'''
|
97 |
# Read car image ( STEP-1 )
|
98 |
+
#img = cv2.imread(img)
|
99 |
+
img = cv2.imdecode(image, cv2.IMREAD_COLOR)
|
100 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
101 |
|
102 |
# First prediction -> Detect car-plate ( STEP-2 )
|
|
|
123 |
st.info('β¨ Supports all popular image formats π· - PNG, JPG, BMP π')
|
124 |
uploaded_file = st.file_uploader("Upload Image of car's number plate π", type=["png","jpg","bmp","jpeg"])
|
125 |
|
|
|
|
|
126 |
if uploaded_file is not None:
|
127 |
|
128 |
+
image = Image.open(uploaded_file).convert('RGB')
|
|
|
129 |
st.image(image, use_column_width=True)
|
130 |
|
|
|
|
|
|
|
|
|
131 |
with st.spinner(f"Working... π«"):
|
132 |
result = FINAL(image)
|
133 |
|