MCPcopy Create free account
hub / github.com/amazon-science/mm-cot / create_loader

Function create_loader

timm/data/loader.py:128–230  ·  view source on GitHub ↗
(
        dataset,
        input_size,
        batch_size,
        is_training=False,
        use_prefetcher=True,
        no_aug=False,
        re_prob=0.,
        re_mode='const',
        re_count=1,
        re_split=False,
        scale=None,
        ratio=None,
        hflip=0.5,
        vflip=0.,
        color_jitter=0.4,
        auto_augment=None,
        num_aug_splits=0,
        interpolation='bilinear',
        mean=IMAGENET_DEFAULT_MEAN,
        std=IMAGENET_DEFAULT_STD,
        num_workers=1,
        distributed=False,
        crop_pct=None,
        collate_fn=None,
        pin_memory=False,
        fp16=False,
        tf_preprocessing=False,
        use_multi_epochs_loader=False,
        persistent_workers=True,
)

Source from the content-addressed store, hash-verified

126
127
128def create_loader(
129 dataset,
130 input_size,
131 batch_size,
132 is_training=False,
133 use_prefetcher=True,
134 no_aug=False,
135 re_prob=0.,
136 re_mode='const',
137 re_count=1,
138 re_split=False,
139 scale=None,
140 ratio=None,
141 hflip=0.5,
142 vflip=0.,
143 color_jitter=0.4,
144 auto_augment=None,
145 num_aug_splits=0,
146 interpolation='bilinear',
147 mean=IMAGENET_DEFAULT_MEAN,
148 std=IMAGENET_DEFAULT_STD,
149 num_workers=1,
150 distributed=False,
151 crop_pct=None,
152 collate_fn=None,
153 pin_memory=False,
154 fp16=False,
155 tf_preprocessing=False,
156 use_multi_epochs_loader=False,
157 persistent_workers=True,
158):
159 re_num_splits = 0
160 if re_split:
161 # apply RE to second half of batch if no aug split otherwise line up with aug split
162 re_num_splits = num_aug_splits or 2
163 dataset.transform = create_transform(
164 input_size,
165 is_training=is_training,
166 use_prefetcher=use_prefetcher,
167 no_aug=no_aug,
168 scale=scale,
169 ratio=ratio,
170 hflip=hflip,
171 vflip=vflip,
172 color_jitter=color_jitter,
173 auto_augment=auto_augment,
174 interpolation=interpolation,
175 mean=mean,
176 std=std,
177 crop_pct=crop_pct,
178 tf_preprocessing=tf_preprocessing,
179 re_prob=re_prob,
180 re_mode=re_mode,
181 re_count=re_count,
182 re_num_splits=re_num_splits,
183 separate=num_aug_splits > 0,
184 )
185

Callers

nothing calls this directly

Calls 3

create_transformFunction · 0.85
PrefetchLoaderClass · 0.85

Tested by

no test coverage detected