Cfg

class jlpy.pytorch.vision.image_classification.lions_cheetahs.Cfg

Bases: object

Static configurations for the project.

Cls img_path:

The directory of the images under the project folder.

Cls sub_dirs:

A list of the image directories for lions and cheetahs.

Cls labels:

0 refers to lions and 1 refers to cheetahs.

Cls img_size:

The standard image size for feeding the model.

Cls img_df:

A pandas DataFrame to store data information.

Cls batch_size:

The size of a batch samplers.

Attention

The Python working directory will be the same as the Jupyter working directory.
img_path will use the relative path to locate the source images.
After this setup, the outputs from both Python and Jupyter will work properly.

Methods

__init__

get_df

Return class attribute.

load_df

Load data into a pandas dataframe.

img_path = '../res/images'
sub_dirs = ('Lions', 'Cheetahs')
labels = (0, 1)
img_size = 256
img_df = Empty DataFrame Columns: [] Index: []
batch_size = 8
classmethod load_df() None

Load data into a pandas dataframe.

From the local drive, extract all file paths and their corresponding labels, and save them in a pandas DataFrame with two columns: file_path and label.

classmethod get_df() DataFrame

Return class attribute.

jldp = None