<jupyter_start><jupyter_text>FastAI Cookbook Ch 2. Examining image datasets in fast.ai> Walkthrough of how to examine image datasets using the facilities in fast.ai.- toc:true- branch: master- badges: true- comments: true- author: <NAME>- categories: [fastai, cookbook, image]<jupyter_code># imports for notebook boilerplate
!pip install -Uqq fastbook
import fastbook
from fastbook import *
from fastai.vision.all import *
# set up the notebook for fast.ai
fastbook.setup_book()
# ingest the curated image dataset FLOWERS
path = untar_data(URLs.FLOWERS)
# examine the directory structure of the dataset
path.ls()
# ingest the train dataset list into a Pandas dataframe

df_valid = pd.read_csv(path/'valid.txt', header=None)
df_valid.head()
# examine the jpg subdirectory
(path/'jpg').ls()
# take a look at one of the images
img_files = get_image_files(path)
img = PILImage.create(img_files[100])
img
# display a thumbnail of the image
img.to_thumb(180)
# ingest the curated image localization dataset BIWI_HEAD_POSE
path = untar_data(URLs.BIWI_HEAD_POSE)
# examine the directory structure of the dataset
path.ls()
# examine one of the subdirectories
(path/"05").ls()
# take a look at one of the images
img_files = get_image_files(path/'10')
img = PILImage.create(img_files[8])
img.to_thumb(180)
# take a look at one of the pose text files
path/'05/frame_00191_pose.txt'
# ingest one of the pose text files into a Pandas dataframe
df_pose = pd.read_csv(path/'05/frame_00191_pose.txt', header=None)
df_pose.head()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup