OmidSakaki commited on
Commit
ecbbbbb
·
verified ·
1 Parent(s): fe659ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -17
app.py CHANGED
@@ -116,11 +116,6 @@ classes_dict = {
116
 
117
  def Plot_Result(raw_plate, digits) :
118
 
119
- #fig = plt.subplots(figsize=(15,10))
120
-
121
- #plt.figure(figsize=(15, 10))
122
- #plt.subplot(2, 1, 2)
123
- # Read raw plate form
124
  raw_plate = cv2.imread(raw_plate)
125
  raw_plate = cv2.cvtColor(raw_plate, cv2.COLOR_BGR2RGB)
126
 
@@ -144,22 +139,12 @@ def Plot_Result(raw_plate, digits) :
144
  cv2.putText(raw_plate, digits[6], p7, cv2.FONT_HERSHEY_COMPLEX, 5, (0, 0, 0), 5, cv2.LINE_AA);
145
  cv2.putText(raw_plate, digits[7], p8, cv2.FONT_HERSHEY_COMPLEX, 5, (0, 0, 0), 5, cv2.LINE_AA);
146
 
147
- #plt.axis('off')
148
- #plt.subplots_adjust(top=0.75)
149
- #plt.imshow(raw_plate)
150
- #ax.imshow(raw_plate)
151
- #ax.show()
152
- #fig = plt.imshow(raw_plate)
153
-
154
- #for img in raw_plate:
155
- # image = Image.fromarray(img)
156
- #image.save('output_image.jpg')
157
 
158
  filename = 'output_image.jpg'
159
  cv2.imwrite(filename, raw_plate)
160
 
161
  out_img = cv2.imread("output_image.jpg")
162
- st.image(out_img)
163
 
164
 
165
  def FINAL(img) :
@@ -199,7 +184,7 @@ if selected_type == "Upload Image":
199
 
200
  if uploaded_file is not None:
201
  image = Image.open(uploaded_file).convert('RGB')
202
- st.image(image, width=400)
203
 
204
  image.save('input_image.jpg')
205
 
 
116
 
117
  def Plot_Result(raw_plate, digits) :
118
 
 
 
 
 
 
119
  raw_plate = cv2.imread(raw_plate)
120
  raw_plate = cv2.cvtColor(raw_plate, cv2.COLOR_BGR2RGB)
121
 
 
139
  cv2.putText(raw_plate, digits[6], p7, cv2.FONT_HERSHEY_COMPLEX, 5, (0, 0, 0), 5, cv2.LINE_AA);
140
  cv2.putText(raw_plate, digits[7], p8, cv2.FONT_HERSHEY_COMPLEX, 5, (0, 0, 0), 5, cv2.LINE_AA);
141
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  filename = 'output_image.jpg'
144
  cv2.imwrite(filename, raw_plate)
145
 
146
  out_img = cv2.imread("output_image.jpg")
147
+ st.image(out_img, caption='final image ✅')
148
 
149
 
150
  def FINAL(img) :
 
184
 
185
  if uploaded_file is not None:
186
  image = Image.open(uploaded_file).convert('RGB')
187
+ st.image(image, width=400, caption='input image 📷')
188
 
189
  image.save('input_image.jpg')
190