text_plain_output_1.png
from keras.preprocessing import image

from tqdm import tqdm

import numpy as np

import numpy as np # linear algebra

import pandas as pd

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

train = pd.read_csv('../input/coronahack-chest-xraydataset/Chest_xray_Corona_Metadata.csv')

train.columns

train_image = []
path = '../input/coronahack-chest-xraydataset/Coronahack-Chest-XRay-Dataset/Coronahack-Chest-XRay-Dataset/'
for i in tqdm(range(train.shape[0])):
    put = 'train' if train['Dataset_type'][i] == 'TRAIN' else 'test'
    img = image.load_img('../input/coronahack-chest-xraydataset/Coronahack-Chest-XRay-Dataset/Coronahack-Chest-XRay-Dataset/' + put + '/' + train['X_ray_image_name'][i], target_size=(256, 256, 3))
    img = image.img_to_array(img)
    img = img / 255
    train_image.append(img)
X = np.array(train_image)

train['Normal'] = 0
train['Pnemonia'] = 0
train['Virus'] = 0
train['bacteria'] = 0
train['Stress-Smoking'] = 0
train['Streptococcus'] = 0
train['COVID-19'] = 0
train['ARDS'] = 0
train['SARS'] = 0
train.head()