Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pycolmap.Image constructor fails in 0.2.0 #68

Closed
mherb opened this issue May 16, 2022 · 1 comment
Closed

pycolmap.Image constructor fails in 0.2.0 #68

mherb opened this issue May 16, 2022 · 1 comment

Comments

@mherb
Copy link

mherb commented May 16, 2022

Hi,

I observed an error that occurs for me when constructing an Image object manually:

import pycolmap

points = [pycolmap.Point2D((100, 200))]
pts = pycolmap.ListPoint2D(points)
image = pycolmap.Image("image.png", pts)

In 0.1.0 this used to work fine, while in 0.2.0 it raises the following error:

Traceback (most recent call last):
  File "image_construct.py", line 5, in <module>
    image = pycolmap.Image("image.png", pts)
RecursionError: maximum recursion depth exceeded while calling a Python object

Note that when default-constructing the object without point list it also works fine.

Environment: Python 3.8 on Ubuntu 20.04, pycolmap 0.2.0 installed from PyPi

@Phil26AT
Copy link
Collaborator

Hi, the problem is that pybind fails to resolve the constructor here. You can either serve the points via the keyword argument:

image = pycolmap.Image("image.png", points2D=pts)

or use the much simpler auto conversion:

import pycolmap
image = pycolmap.Image("image.png", keypoints=[(100,200)])
# or
image = pycolmap.Image("image.png", [(100,200)])

On branch fix-image-constructor I pushed a fix which should also resolve your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants