<jupyter_start><jupyter_text>Exploring the data So let's learn how we set up the data.<jupyter_code>#default_exp data
#hide
import os, sys, warnings
os.getcwd()
#export
#root = "D:/data_sets/24_garden"
#os.chdir(root+'/garden')
#export
from fastai2.vision.all import *
#export
from garden2.utils import *
#hide
warnings.filterwarnings("ignore", category=RuntimeWarning) 
warnings.filterwarnings("ignore", category=UserWarning) 
#export
path = root + "/data"
#hide
#os.chdir(root)
#export
path_img = Path(path+'/jpeg224x224')
#export
train_fnames = get_files(path_img/'train', extensions='.tfrec')
test_fnames = get_files(path_img/'val', extensions='.tfrec')
os.getcwd()
#export
data = []
for name in train_fnames+test_fnames:
  r = Reader(str(name), unpack_sample)
  for sample in r:
    data.append([sample['image'][0], sample['class'][0]])

get_x = lambda o: PILImage.create(io.BytesIO(o[0]))
get_y = lambda o: o[1]

def get_items(_): return data<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15337423312883436, 'fraction_numerical': 0.014314928425357873, 'mean_word_length': 6.708661417322834, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '46320', 'license': 'Apache-2.0', 'n_tokens_mistral': 376, 'n_tokens_neox': 367, 'n_words': 80, 'path': '02_data.ipynb', 'repo_name': 'sso0090/garden2', 'size': '978'}