text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

WORK_DIR = '../input/ranzcr-clip-catheter-line-classification'
os.listdir(WORK_DIR)

train = pd.read_csv(os.path.join(WORK_DIR, 'train.csv'))
train_images = '../input/ranzcr-clip-catheter-line-classification' + '/train/' + train['StudyInstanceUID'] + '.jpg'
ss = pd.read_csv(os.path.join(WORK_DIR, 'sample_submission.csv'))
test_images = '../input/ranzcr-clip-catheter-line-classification' + '/test/' + ss['StudyInstanceUID'] + '.jpg'
label_cols = ss.columns[1:]
labels = train[label_cols].values
train_annot = pd.read_csv(os.path.join(WORK_DIR, 'train_annotations.csv'))

sns.set_style("whitegrid")
fig = plt.figure(figsize = (15, 12), dpi = 300)
plt.suptitle('Labels count', fontfamily = 'serif', size = 15)

for ind, i in enumerate(label_cols):
    fig.add_subplot(4, 3, ind + 1)

    sns.countplot(train[i], edgecolor = 'black',
                  palette = reversed(sns.color_palette('viridis', 2)))
    
    plt.xlabel('')
    plt.ylabel('')
    plt.xticks(fontfamily = 'serif', size = 10)
    plt.yticks(fontfamily = 'serif', size = 10)
    plt.title(i, fontfamily = 'serif', size = 10)
plt.show()

sample = train.sample(9)
plt.figure(figsize=(10, 7), dpi=300)
for ind, image_id in enumerate(sample.StudyInstanceUID):
    plt.subplot(3, 3, ind + 1)
    image = image_id + '.jpg'
    img = cv2.imread(os.path.join(WORK_DIR, 'train', image))
    img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
    plt.imshow(img)
    plt.title('Shape: {}'.format(img.shape[:2]))
    plt.axis('off')
plt.show()