MCPcopy Create free account
hub / github.com/dcharatan/flowmap / Mapping

Class Mapping

flowmap/loss/mapping/mapping.py:30–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29
30class Mapping(nn.Module, ABC, Generic[T]):
31 def __init__(self, cfg: T) -> None:
32 super().__init__()
33 self.cfg = cfg
34
35 def forward(
36 self,
37 a: Float[Tensor, "*#batch 2"],
38 b: Float[Tensor, "*#batch 2"],
39 image_shape: tuple[int, int],
40 ) -> Float[Tensor, " *batch"]:
41 a = fix_aspect_ratio(a, image_shape)
42 b = fix_aspect_ratio(b, image_shape)
43 return self.forward_undistorted(a - b)
44
45 @abstractmethod
46 def forward_undistorted(
47 self,
48 delta: Float[Tensor, "*batch 2"],
49 ) -> Float[Tensor, " *batch"]:
50 pass

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected