MCPcopy Create free account
hub / github.com/MetaSLAM/SphereVLAD / __call__

Method __call__

dataloader/data_augmentation.py:128–140  ·  view source on GitHub ↗
(self, coords)

Source from the content-addressed store, hash-verified

126 self.p_cum_sum = np.cumsum(p)
127
128 def __call__(self, coords):
129 r = random.random()
130 if r <= self.p_cum_sum[0]:
131 # Flip the first axis
132 coords[..., 0] = -coords[..., 0]
133 elif r <= self.p_cum_sum[1]:
134 # Flip the second axis
135 coords[..., 1] = -coords[..., 1]
136 elif r <= self.p_cum_sum[2]:
137 # Flip the third axis
138 coords[..., 2] = -coords[..., 2]
139
140 return coords
141
142
143class RandomRotation:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected