text_html_output_1.png
from torchvision import datasets,models,transforms

import PIL

import glob as glob

import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

len(glob.glob('../input/jpg-images/train_jpg/*jpg'))

len(glob.glob('../input/jpg-images/test_jpg/*jpg'))

meta_vir = pd.read_csv('../input/rsna-2022-spine-fracture-detection-metadata/meta_train_with_vertebrae.csv')

y = meta_vir.iloc[:3408, 9:]
y.shape

del y['overall']
y.z_total.value_counts()

labels = np.array(y)
labels.shape

train_transforms = Compose([LoadImage(image_only=True), transforms.ToTensor(), EnsureChannelFirst(), ScaleIntensity(), RandRotate(range_x=np.pi / 12, prob=0.5, keep_size=True), RandFlip(spatial_axis=0, prob=0.5), RandZoom(min_zoom=0.9, max_zoom=1.1, prob=0.5)])
val_transforms = Compose([LoadImage(image_only=True), transforms.ToTensor(), EnsureChannelFirst(), ScaleIntensity()])

image_files_list = glob.glob('../input/jpg-images/train_jpg/*.jpg')
plt.subplots(3, 3, figsize=(8, 8))
for i in range(9):
    im = PIL.Image.open(image_files_list[i])
    arr = np.array(im)
    plt.subplot(3, 3, i + 1)
    plt.imshow(arr, cmap='gray')
plt.tight_layout()
plt.show()