Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created December 24, 2020 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/f9826fb8081abf7bba0961dc3a88f439 to your computer and use it in GitHub Desktop.
Save amankharwal/f9826fb8081abf7bba0961dc3a88f439 to your computer and use it in GitHub Desktop.
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