Spaces:
Paused
Paused
Commit ·
d84fc0b
1
Parent(s): c7fc93a
Update app.py
Browse files30 unmodified lines3132333435363730 unmodified linesdef decode_batch_predictions(pred):input_len = np.ones(pred.shape[0]) * pred.shape[1]# Use greedy search. For complex tasks, you can use beam searchresults = keras.backend.ctc_decode(pred, input_length=input_len, greedy=False, beam_width=5)[0][0][:, :max_length]# Iterate over the results and get back the text30 unmodified lines3132333435363730 unmodified linesdef decode_batch_predictions(pred):input_len = np.ones(pred.shape[0]) * pred.shape[1]# Use greedy search. For complex tasks, you can use beam searchresults = keras.backend.ctc_decode(pred, input_length=input_len, greedy=True)[0][0][:, :max_length]# Iterate over the results and get back the text
app.py+1-1