OmidSakaki commited on
Commit
4b75153
Β·
verified Β·
1 Parent(s): df7da7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
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 = np.array(Image.open(uploaded_file))
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