limap.line2d.L2D2 package
Submodules
limap.line2d.L2D2.RAL_net_cov module
- class limap.line2d.L2D2.RAL_net_cov.L2Net
Bases:
Module
- forward(input)
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- input_norm(x)
- training: bool
- class limap.line2d.L2D2.RAL_net_cov.L2Norm
Bases:
Module
- forward(x)
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
- limap.line2d.L2D2.RAL_net_cov.get_net()
- limap.line2d.L2D2.RAL_net_cov.weights_init(m)
limap.line2d.L2D2.extractor module
- class limap.line2d.L2D2.extractor.L2D2Extractor(options=BaseDetectorOptions(set_gray=True, max_num_2d_segs=3000, do_merge_lines=False, visualize=False, weight_path=None), device=None)
Bases:
BaseDetector
- compute_descinfo(img, segs)
A desc_info is composed of the following tuple / np arrays: - the line descriptors [N, 128]
- download_model(path)
- extract(camview, segs)
Virtual method (for extractor) - extract the features for the detected segments
- Parameters:
view (
limap.base.CameraView
) – The limap.base.CameraView instance corresponding to the imagesegs –
np.array
of shape (N, 5), line detections. Each row corresponds to x1, y1, x2, y2 and score. Computed from the detect method.
- Returns:
The extracted feature
- get_descinfo_fname(descinfo_folder, img_id)
Virtual method (for extractor) - Get the target filename of the extracted feature
- Parameters:
descinfo_folder (str) – The output folder
img_id (int) – The image id
- Returns:
target filename
- Return type:
str
- get_module_name()
Virtual method (need to be implemented) - return the name of the module
- get_patch(img, line)
Extract a 48x32 patch around a line [2, 2].
- read_descinfo(descinfo_folder, img_id)
Virtual method (for extractor) - Read in the extracted feature. Dual function for save_descinfo.
- Parameters:
descinfo_folder (str) – The output folder
img_id (int) – The image id
- Returns:
The extracted feature
- save_descinfo(descinfo_folder, img_id, descinfo)
Virtual method (for extractor) - Save the extracted feature to the target folder
- Parameters:
descinfo_folder (str) – The output folder
img_id (int) – The image id
descinfo – The features extracted from the function extract
limap.line2d.L2D2.matcher module
- class limap.line2d.L2D2.matcher.L2D2Matcher(extractor, options=BaseMatcherOptions(topk=10, n_neighbors=20, n_jobs=1, weight_path=None))
Bases:
BaseMatcher
- check_compatibility(extractor)
- get_module_name()
- match_pair(descinfo1, descinfo2)
- match_segs_with_descinfo(descinfo1, descinfo2)
- match_segs_with_descinfo_topk(descinfo1, descinfo2, topk=10)