Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -97,7 +97,8 @@ num_to_char = layers.StringLookup(
|
|
97 |
vocabulary=char_to_num.get_vocabulary(), mask_token=None, invert=True
|
98 |
)
|
99 |
|
100 |
-
def decode_batch_predictions(
|
|
|
101 |
input_len = np.ones(pred.shape[0]) * pred.shape[1]
|
102 |
# Use greedy search. For complex tasks, you can use beam search.
|
103 |
results = keras.backend.ctc_decode(pred, input_length=input_len, greedy=True)[0][0][
|
|
|
97 |
vocabulary=char_to_num.get_vocabulary(), mask_token=None, invert=True
|
98 |
)
|
99 |
|
100 |
+
def decode_batch_predictions(input_image):
|
101 |
+
pred = loaded_model.predict(input_image)
|
102 |
input_len = np.ones(pred.shape[0]) * pred.shape[1]
|
103 |
# Use greedy search. For complex tasks, you can use beam search.
|
104 |
results = keras.backend.ctc_decode(pred, input_length=input_len, greedy=True)[0][0][
|