Skip to content

poselib-2.0.4 estimate_relative_pose need an additional dict as input. #154

@Chen-AMD4800U

Description

@Chen-AMD4800U

Thanks for your outstanding work!!!!!

I had some problems while using glure-fatory to eval Megadepth. Although the problems were solved, i change some code in gluefactory/robust_estimators/relative_pose/poselib.py, so i think i need to submit an issue.

poselib version: 2.0.4
config:
{'checkpoint': None, 'data': {'depth_dir': '{scene}/depths', 'depth_format': 'h5', 'image_dir': '{scene}/images', 'name': 'posed_images', 'preprocessing': {'resize': 1600, 'side': 'long'}, 'root': '', 'scene_list': ['megadepth1500'], 'view_groups': '{scene}/pairs.txt', 'views': '{scene}/views.txt'}, 'eval': {'estimator': 'poselib', 'ransac_th': 0.5}, 'model': {'extractor': {'name': 'extractors.ripe', 'threshold': 1.0, 'top_k': 2048}, 'ground_truth': {'name': None}, 'matcher': {'name': 'matchers.nearest_neighbor_matcher'}, 'name': 'two_view_pipeline'}}
(ripe is a ICCV25 work. RIPE)

As shown above, i use poselib as estimator.
However, if i directly use function (line 21 - line 30)
M, info = poselib.estimate_relative_pose(
pts0.numpy(),
pts1.numpy(),
camera0.to_cameradict(),
camera1.to_cameradict(),
{
"max_epipolar_error": self.conf.ransac_th,
**OmegaConf.to_container(self.conf.options),
},
)

it will return an input error:

TypeError: estimate_relative_pose(): incompatible function arguments. The following argument types are supported: 1. (arg0: numpy.ndarray[numpy.float64[m, 2]], arg1: numpy.ndarray[numpy.float64[m, 2]], arg2: poselib.Camera, arg3: poselib.Camera, arg4: dict, arg5: dict) -> tuple[poselib.CameraPose, dict] 2. (arg0: numpy.ndarray[numpy.float64[m, 2]], arg1: numpy.ndarray[numpy.float64[m, 2]], arg2: dict, arg3: dict, arg4: dict, arg5: dict) -> tuple[poselib.CameraPose, dict]

it seems that poselib add bundle_opt dict as a forced Input.
so i changed code to below as a temporary form.

M, info = poselib.estimate_relative_pose(
pts0.numpy(),
pts1.numpy(),
camera0.to_cameradict(),
camera1.to_cameradict(),
{
"max_epipolar_error": self.conf.ransac_th,
**OmegaConf.to_container(self.conf.options),
},
{} # use for bundle_opt. - poselib 2.0.4
)

And then, code will run well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions