utils package

Submodules

utils.common_utils module

Utility file consisting of common functions and variables used during training and evaluation

utils.common_utils.read_json_data(file_name)[source]

Utility function to read data from json file

Parameters

file_name (str) – Path to json file to be read

Returns

article_list (List<dict>) – List of dict that contains metadata for each item

utils.common_utils.get_accuracy(y_pred, y_actual)[source]

Utility function to compute accuracy for the minibatch

Parameters
  • y_pred (Tensor) – Predicted class labess

  • y_actual (Tensor) – Ground Truth class labels

utils.config module

Basic configuration and settings for training the model

utils.dataset module

class utils.dataset.EthnicFinderDataset(metadata_file, mode, transform=None)[source]

Bases: torch.utils.data.dataset.Dataset

Custom dataset class for Cloth Classsification

__init__(metadata_file, mode, transform=None)[source]
Parameters
  • metadata_file (string) – Path to the json file with annotations.

  • mode (string) – train, test, val

  • transform (callable) – Transform to be applied on a sample.

Returns

None

__getitem__(idx)[source]

Returns sample corresponding to the index idx

__len__()[source]

Returns length of the dataset

utils.enums module

Enums for cloth categories corresponding to class labels

utils.tflogger module

Module contents