Last active
July 14, 2018 06:00
-
-
Save JarvusChen/2ae1311a462244ac2cdd529b3d995751 to your computer and use it in GitHub Desktop.
Predict plate number by CTC loss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# predict number | |
X = cv2.imread('test1.jpg') | |
X = X.transpose(1, 0, 2).reshape(1,70,30,3) | |
y_pred = base_model.predict(X) | |
y_pred = y_pred[:,2:,:] | |
out = K.get_value(K.ctc_decode(y_pred, input_length=np.ones(y_pred.shape[0])*y_pred.shape[1], )[0][0])[:, :7] | |
out = ''.join([chars[x] for x in out[0]]) | |
print(out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment