Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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