text_plain_output_1.png
from PIL import Image, ImageDraw, ImageEnhance #for read the image

import os

import pandas as pd #dataframe manipulation

import seaborn as sns #for visualization

train = pd.read_csv('/kaggle/input/machinehack-watermark-challenge/train.csv')
test = pd.read_csv('/kaggle/input/machinehack-watermark-challenge/test.csv')

_=sns.countplot(x=train['Label'],order=train['Label'].value_counts().index);
_=plt.title("Target Label Distribution",fontsize=18)

def img_read(path, im, new_size=False):
    img = Image.open(f'{os.path.join(path, im)}')
    if new_size:
        img = img.resize((224, 224))
        return img
    else:
        return img

path = '/kaggle/input/machinehack-watermark-challenge/train'
fig = plt.figure(figsize=(8, 15))
for i, label in enumerate(['Watermark', 'No Watermark']):
    _ = plt.subplot(1, 2, i + 1)
    img = img_read(path, train[train['Label'] == label]['Image'].head(1).values[0])
    plt.imshow(img)
    plt.axis('off')
    plt.title(f"{('With Watermark' if label == 'Watermark' else 'No Watermark')}")