Atualli commited on
Commit
269931b
·
1 Parent(s): db2d9c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ DECODE_DICT = {i:char for i, char in enumerate(CHARS)}
8
 
9
  interpreter = tf.lite.Interpreter(model_path='detection.tflite')
10
  interpreter.allocate_tensors()
11
- recog_interpreter = tf.lite.Interpreter(model_path='recognition.tflite')
12
  recog_input_details = recog_interpreter.get_input_details()
13
  recog_output_details = recog_interpreter.get_output_details()
14
  recog_interpreter.resize_tensor_input(recog_input_details[0]['index'], (1, 24, 94, 3))
@@ -46,7 +46,7 @@ def execute_text_recognition_tflite( boxes, frame, interpreter, input_details, o
46
  return text,cv2.resize(save_frame,(94,24))
47
 
48
  def greet(image):
49
- resized = cv2.resize(image, (480,480), interpolation=cv2.INTER_CUBIC)
50
  input_data = resized.astype(np.float32) # Set as 3D RGB float array
51
  input_data /= 255. # Normalize
52
  input_data = np.expand_dims(input_data, axis=0) # Batch dimension (wrap in 4D)
 
8
 
9
  interpreter = tf.lite.Interpreter(model_path='detection.tflite')
10
  interpreter.allocate_tensors()
11
+ recog_interpreter = tf.lite.Interpreter(model_path='recognition2.tflite')
12
  recog_input_details = recog_interpreter.get_input_details()
13
  recog_output_details = recog_interpreter.get_output_details()
14
  recog_interpreter.resize_tensor_input(recog_input_details[0]['index'], (1, 24, 94, 3))
 
46
  return text,cv2.resize(save_frame,(94,24))
47
 
48
  def greet(image):
49
+ resized = cv2.resize(image, (320,320), interpolation=cv2.INTER_CUBIC)
50
  input_data = resized.astype(np.float32) # Set as 3D RGB float array
51
  input_data /= 255. # Normalize
52
  input_data = np.expand_dims(input_data, axis=0) # Batch dimension (wrap in 4D)