<filename>sdt/data.py
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_data.ipynb (unless otherwise specified).

__all__ = ['get_dls']

# Cell
from fastai.vision.all import *

# Cell
def get_dls(path, bs=4, num_workers=2):
    """
    Given image path, load the images.
    Batch size is specified by `bs` (default=4).
    """
    mnist = DataBlock(blocks=(ImageBlock(cls=PILImageBW), CategoryBlock),
                  get_items=get_image_files,
                  splitter=RandomSplitter(),
                  get_y=parent_label,
                  batch_tfms=Normalize.from_stats(*(0.1307,), (0.3081,))
                  )
    dls = mnist.dataloaders(path, bs=bs, num_workers=num_workers)

    return dls
<filename>sdt/data.py
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_data.ipynb (unless otherwise specified).

__all__ = ['get_dls']

# Cell
from fastai.vision.all import *

# Cell
def get_dls(path, bs=4, num_workers=2):
    """
    Given image path, load the images.
    Batch size is specified by `bs` (default=4).
    """
    mnist = DataBlock(blocks=(ImageBlock(cls=PILImageBW), CategoryBlock),
                  get_items=get_image_files,
                  splitter=RandomSplitter(),
                  get_y=parent_label,
                  batch_tfms=Normalize.from_stats(*(0.1307,), (0.3081,))
                  )
    dls = mnist.dataloaders(path, bs=bs, num_workers=num_workers)

    return dls
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_data.ipynb (unless otherwise specified). # Cell # Cell Given image path, load the images.     Batch size is specified by `bs` (default=4).