8000 Memory Leak in absolute_pose_estimation · Issue #4 · colmap/pycolmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content < 10000 span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">
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.
Memory Leak in absolute_pose_estimation #4
Closed
@SergioRAgostinho

Description

@SergioRAgostinho

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
Screenshot from 2021-02-19 15-22-32

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

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

      0