application_vnd.jupyter.stderr_output_1.png
from PIL import Image

import os

import os

import numpy as np
import pandas as pd
import os

path_validation = Path('/kaggle/input/food-validation/images/')
path_training = Path('/kaggle/input/food-training/images/')
image_files = os.listdir(path_training)
for i in range(2):
    image_path = os.path.join(path_training, image_files[i])
    image_pathv = os.path.join(path_validation, image_files[i])

path_annotations = Path('/kaggle/input/food-training/annotations.json')
label_func = lambda x: annotations[str(x.parent.name + '/' + x.name)]['name']

sample_image_file = os.listdir(path_training)[0]
print(sample_image_file)
sample_image = Image.open(path_training / sample_image_file)
sample_label = label_func(sample_image)
print(sample_label)