(self, coord, coord1=None)
| 845 | self.p = p |
| 846 | |
| 847 | def __call__(self, coord, coord1=None): |
| 848 | if np.random.rand() < self.p: |
| 849 | angle_z = np.random.uniform(-self.rot, self.rot) |
| 850 | cos_z, sin_z = np.cos(angle_z), np.sin(angle_z) |
| 851 | R = np.array([[cos_z, -sin_z, 0], [sin_z, cos_z, 0], [0, 0, 1]]) |
| 852 | coord = np.dot(coord, R) |
| 853 | if coord1 is not None: |
| 854 | coord1 = np.dot(coord1, R) |
| 855 | return coord, coord1 |
| 856 | |
| 857 | class Compose(object): |
| 858 | def __init__(self, transforms): |
nothing calls this directly
no outgoing calls
no test coverage detected