-
-
Save amankharwal/f9826fb8081abf7bba0961dc3a88f439 to your computer and use it in GitHub Desktop.
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
model.evaluate_generator(validation_generator, steps=STEP_SIZE_VAL) | |
for idx, row in df.iloc[lucky_test_samples].iterrows(): | |
img = cv2.resize(cv2.imread("Indian Number Plates/" + row[0]) / 255.0, dsize=(WIDTH, HEIGHT)) | |
y_hat = model.predict(img.reshape(1, WIDTH, HEIGHT, 3)).reshape(-1) * WIDTH | |
xt, yt = y_hat[0], y_hat[1] | |
xb, yb = y_hat[2], y_hat[3] | |
img = cv2.cvtColor(img.astype(np.float32), cv2.COLOR_BGR2RGB) | |
image = cv2.rectangle(img, (xt, yt), (xb, yb), (0, 0, 255), 1) | |
plt.imshow(image) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment