MCPcopy Create free account
hub / github.com/pytorch/tutorials / __init__

Method __init__

beginner_source/data_loading_tutorial.py:123–133  ·  view source on GitHub ↗

Arguments: csv_file (string): Path to the csv file with annotations. root_dir (string): Directory with all the images. transform (callable, optional): Optional transform to be applied on a sample.

(self, csv_file, root_dir, transform=None)

Source from the content-addressed store, hash-verified

121 """Face Landmarks dataset."""
122
123 def __init__(self, csv_file, root_dir, transform=None):
124 """
125 Arguments:
126 csv_file (string): Path to the csv file with annotations.
127 root_dir (string): Directory with all the images.
128 transform (callable, optional): Optional transform to be applied
129 on a sample.
130 """
131 self.landmarks_frame = pd.read_csv(csv_file)
132 self.root_dir = root_dir
133 self.transform = transform
134
135 def __len__(self):
136 return len(self.landmarks_frame)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected