This repository was archived by the owner on Feb 25, 2025. It is now read-only.
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Description
Hey Mihai,
I just found out that absolute_pose_estimation is leaking memory. This was verified with the repository at the following point in time 03eb8a4
MVE
import gc
from memory_profiler import profile
import numpy as np
from pycolmap import absolute_pose_estimation
@profile
def estimation_pose():
# instantiate a couple of points centered around the origin
pts = 0.6 * (np.random.random((6, 3)) - 0.5)
# Made up projective matrix
K = np.array([[160, 0, 320], [0, 120, 240], [0, 0, 1]])
# A pose
R_gt = np.array(
[
[-0.48048015, 0.1391384, -0.86589799],
[-0.0333282, -0.98951829, -0.14050899],
[-0.8763721, -0.03865296, 0.48008113],
]
)
t_gt = np.array([-0.10266772, 0.25450789, 1.70391109])
# Project points to 2D
pts_2d = (pts @ R_gt.T + t_gt) @ K.T
pts_2d = (pts_2d / pts_2d[:, -1, None])[:, :-1]
camera = dict(
model="SIMPLE_PINHOLE", width=640, height=480, params=[160.0, 320.0, 240.0]
)
absolute_pose_estimation(pts_2d, pts, camera, 1.0)
gc.collect()
while True:
estimation_pose()
This is producing the following memory footprint
I checked the function and everything seems to be ok. This might be an issue in your dependencies, but I thought about letting you know anyway.
Cheers
Metadata
Metadata
Assignees
Labels
No labels