text_html_output_1.png
import matplotlib.pyplot as plt

import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train_df = pd.read_csv('../input/plant-pathology-2020-fgvc7/train.csv')

def get_label(row):
    for c in train_df.columns[1:]:
        if row[c] == 1:
            return c
train_df_copy = train_df.copy()
train_df_copy['label'] = train_df_copy.apply(get_label, axis=1)

sample_img = train_df.iloc[1, 0]
sample_labels = train_df.iloc[1, :]
sample_labels = np.asarray(sample_labels)

leaf_sample_dataset = LeafDataset(df=train_df, transform=None)
fig, ax = plt.subplots(1, 3)
for i in range(3):
    img, label = leaf_sample_dataset[i]
    ax[i].imshow(img)
    print(type(img), img.size, label)