Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created December 24, 2020 15:11
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/8cd93b0f38f1d090746802592097c395 to your computer and use it in GitHub Desktop.
Save amankharwal/8cd93b0f38f1d090746802592097c395 to your computer and use it in GitHub Desktop.
lucky_test_samples = np.random.randint(0, len(df), 5)
reduced_df = df.drop(lucky_test_samples, axis=0)
WIDTH = 224
HEIGHT = 224
CHANNEL = 3
def show_img(index):
image = cv2.imread("Indian Number Plates/" + df["image_name"].iloc[index])
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
image = cv2.resize(image, dsize=(WIDTH, HEIGHT))
tx = int(df["top_x"].iloc[index] * WIDTH)
ty = int(df["top_y"].iloc[index] * HEIGHT)
bx = int(df["bottom_x"].iloc[index] * WIDTH)
by = int(df["bottom_y"].iloc[index] * HEIGHT)
image = cv2.rectangle(image, (tx, ty), (bx, by), (0, 0, 255), 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment