justin2341 commited on
Commit
5be2390
·
verified ·
1 Parent(s): 9cfc80e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -55,12 +55,12 @@ def alpr():
55
  result = "None"
56
  license = {}
57
  box = {}
58
- print("-----------------------------")
59
  file = request.files['file']
60
 
61
  try:
62
  image = cv2.imdecode(np.frombuffer(file.read(), np.uint8), cv2.IMREAD_COLOR)
63
-
64
  except:
65
  result = "Failed to open file1"
66
  response = jsonify({"result": result, "plate number": license, "coordinate": box})
@@ -117,7 +117,8 @@ def alpr_base64():
117
  imageBase64 = content['base64']
118
  image_data = base64.b64decode(imageBase64)
119
  np_array = np.frombuffer(image_data, np.uint8)
120
- image = cv2.imdecode(np_array, cv2.IMREAD_COLOR)
 
121
  except:
122
  result = "Failed to open file1"
123
  response = jsonify({"result": result, "plate number": license, "coordinate": box})
 
55
  result = "None"
56
  license = {}
57
  box = {}
58
+
59
  file = request.files['file']
60
 
61
  try:
62
  image = cv2.imdecode(np.frombuffer(file.read(), np.uint8), cv2.IMREAD_COLOR)
63
+ image = cv2.resize(image, (1024, 640))
64
  except:
65
  result = "Failed to open file1"
66
  response = jsonify({"result": result, "plate number": license, "coordinate": box})
 
117
  imageBase64 = content['base64']
118
  image_data = base64.b64decode(imageBase64)
119
  np_array = np.frombuffer(image_data, np.uint8)
120
+ image = cv2.imdecode(np_array, cv2.IMREAD_COLOR)
121
+ image = cv2.resize(image, (1024, 640))
122
  except:
123
  result = "Failed to open file1"
124
  response = jsonify({"result": result, "plate number": license, "coordinate": box})