Skip to content

--f_mm argument in demo.py rejects float values (type=int) #89

Description

@kleer001

First off — great work on GVHMR! The world-grounded recovery is a real step forward for monocular mocap pipelines.

I ran into a small issue when passing focal lengths from a COLMAP camera solve to demo.py. The --f_mm argument is defined as type=int in argparse, which rejects float values:

demo.py: error: argument --f_mm: invalid int value: '51.89029508963282'

Camera solves (COLMAP, RealityCapture, etc.) naturally produce float focal lengths, and even real-world lenses aren't always round numbers (e.g. 50.6mm vintage primes, or any anamorphic equivalent).

Where

tools/demo/demo.py, argument parser:

parser.add_argument("--f_mm", type=int, default=None, ...)

Suggested Fix

Change type=int to type=float:

parser.add_argument("--f_mm", type=float, default=None, ...)

The downstream usage in create_camera_sensor() is a float multiplication (diag_img / diag_fullframe * f_fullframe), so this should be a safe change with no side effects. The default fallback path (np.random.choice([24, 26, 28, ...])) also works fine as float.

Workaround

For anyone hitting this in the meantime — rounding '51.89029508963282' to int (--f_mm 52) works but loses precision from your camera solve.

Thanks again for the excellent project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions