MCPcopy
hub / github.com/nitrain/nitrain / __call__

Method __call__

nitrain/samplers/slice_patch.py:26–37  ·  view source on GitHub ↗
(self, x, y)

Source from the content-addressed store, hash-verified

24 self.shuffle = shuffle
25
26 def __call__(self, x, y):
27 # create slices of all images
28 x = create_slices(x, self.axis)
29 y = create_slices(y, self.axis)
30 # then create patches from all those slices
31 x, y = create_patches(x, y, self.patch_size, self.stride)
32
33 self.x = x
34 self.y = y
35 self.n_batches = math.ceil(len(x) / self.batch_size)
36
37 return self
38
39 def __iter__(self):
40 """

Callers

nothing calls this directly

Calls 2

create_slicesFunction · 0.85
create_patchesFunction · 0.70

Tested by

no test coverage detected