MCPcopy Create free account
hub / github.com/drinkingcoder/NeuralMarker / __init__

Method __init__

core/utils/transformation.py:18–34  ·  view source on GitHub ↗
(self, tps_grid_size=3, tps_reg_factor=0, out_h=240, out_w=240,
                 offset_factor=1.0,
                 padding_crop_factor=None,
                 use_cuda=True)

Source from the content-addressed store, hash-verified

16 """
17
18 def __init__(self, tps_grid_size=3, tps_reg_factor=0, out_h=240, out_w=240,
19 offset_factor=1.0,
20 padding_crop_factor=None,
21 use_cuda=True):
22 self.padding_crop_factor = padding_crop_factor
23
24 self.affTnf = GeometricTnf(out_h=out_h, out_w=out_w,
25 geometric_model='affine',
26 offset_factor=offset_factor if padding_crop_factor is None else padding_crop_factor,
27 use_cuda=use_cuda)
28
29 self.tpsTnf = GeometricTnf(out_h=out_h, out_w=out_w,
30 geometric_model='tps',
31 tps_grid_size=tps_grid_size,
32 tps_reg_factor=tps_reg_factor,
33 offset_factor=offset_factor if padding_crop_factor is None else 1.0,
34 use_cuda=use_cuda)
35
36 def __call__(self, image_batch, theta_aff, theta_aff_tps, use_cuda=True):
37 sampling_grid_aff = self.affTnf(image_batch=None,

Callers

nothing calls this directly

Calls 1

GeometricTnfClass · 0.85

Tested by

no test coverage detected