Skip to content

Conversation

@B1ueber2y
Copy link
Contributor

@B1ueber2y B1ueber2y commented Dec 23, 2024

Fixes: #3070

Per discussion from #3071

@B1ueber2y
Copy link
Contributor Author

B1ueber2y commented Dec 23, 2024

Example:

import pycolmap
p = pycolmap.Point2D()
p.point3D_id = pycolmap.INVALID_POINT3D_ID

@B1ueber2y
Copy link
Contributor Author

On the other hand, I have made several attempts to improve the doc rendering of Image class (e.g., B1ueber2y@e205e62). But no luck so far.

@ahojnnes
Copy link
Contributor

ahojnnes commented Dec 23, 2024

Thanks. Nit: For consistency across Python, I would suggest calling it INVALID_POINT3D_ID etc. It could also make sense to adjust the str __repr__ to print out kInvalidPoint3DId or INVALID_POINT3D_ID instead of -1?

@B1ueber2y
Copy link
Contributor Author

Thanks. Nit: For consistency across Python, I would suggest calling it INVALID_POINT3D_ID etc. It could also make sense to adjust the str __repr__ to print out kInvalidPoint3DId or INVALID_POINT3D_ID instead of -1?

Thanks. I have updated the names to upper cases. Now the __repr__ is controlled in the C++ side after the recent update: https://github.com/colmap/colmap/blob/main/src/colmap/scene/image.cc#L107 (while the one for point2D is missing still), so the pybind part does not help.

@sarlinpe
Copy link
Member

sarlinpe commented Dec 23, 2024

On the other hand, I have made several attempts to improve the doc rendering of Image class (e.g., B1ueber2y@e205e62). But no luck so far.

You need to replace

"camera_id"_a = kInvalidCameraId,

by

py::arg_v("camera_id", kInvalidCameraId, "pycolmap.INVALID_CAMERA_ID"),

and so on.

@B1ueber2y
Copy link
Contributor Author

On the other hand, I have made several attempts to improve the doc rendering of Image class (e.g., B1ueber2y@e205e62). But no luck so far.

You need to replace

"camera_id"_a = kInvalidCameraId,

by

py::arg_v("camera_id", kInvalidCameraId, "pycolmap.INVALID_CAMERA_ID"),

and so on.

Thanks. Updated.

Copy link
Member

@sarlinpe sarlinpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, can you also update this one?

"point3D_id"_a = kInvalidPoint3DId)

@B1ueber2y
Copy link
Contributor Author

Thanks, can you also update this one?

"point3D_id"_a = kInvalidPoint3DId)

I think this was already updated?

@sarlinpe
Copy link
Member

I missed it, sorry.

@B1ueber2y B1ueber2y merged commit e924f0f into colmap:main Dec 23, 2024
16 checks passed
@B1ueber2y B1ueber2y deleted the fix/pycolmap_invalid_id branch December 23, 2024 15:45
HernandoR pushed a commit to HernandoR/colmap that referenced this pull request Dec 30, 2024
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

Successfully merging this pull request may close these issues.

pycolmap: Point2D.point3D_id cannot be assigned

3 participants