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

Method __call__

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

Source from the content-addressed store, hash-verified

150 return expm(np.cross(np.eye(3), axis / norm(axis) * theta)).astype(np.float32)
151
152 def __call__(self, coords):
153 if self.axis is not None:
154 axis = self.axis
155 else:
156 axis = np.random.rand(3) - 0.5
157 R = self._M(axis, (np.pi * self.max_theta / 180) * 2 * (np.random.rand(1) - 0.5))
158 if self.max_theta2 is None:
159 coords = coords @ R
160 else:
161 R_n = self._M(np.random.rand(3) - 0.5, (np.pi * self.max_theta2 / 180) * 2 * (np.random.rand(1) - 0.5))
162 coords = coords @ R @ R_n
163
164 return coords
165
166
167class RandomTranslation:

Callers

nothing calls this directly

Calls 1

_MMethod · 0.95

Tested by

no test coverage detected