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

Problem when training xfeat+lightglue #94

Open
limymy opened this issue Jan 26, 2025 · 0 comments
Open

Problem when training xfeat+lightglue #94

limymy opened this issue Jan 26, 2025 · 0 comments

Comments

@limymy
Copy link

limymy commented Jan 26, 2025

Thanks for open-sourcing this awesome work! I've successfully trained xfeat using your code. I'm running into some issues trying to train lightglue with xfeat as an extractor, following your instructions(#67 (comment)). The results are pretty bad when I evaluate with gluefactory.
After pre-training on the homography dataset:

best threshold = 2.5
{'H_error_dlt@1px': 0.0052,
 'H_error_dlt@3px': 0.0284,
 'H_error_dlt@5px': 0.0529,
 'H_error_ransac@1px': 0.265,
 'H_error_ransac@3px': 0.546,
 'H_error_ransac@5px': 0.6666,
 'H_error_ransac_mAA': 0.4925333333333333,
 'mH_error_dlt': 61.393,
 'mH_error_ransac': 0.994,
 'mnum_keypoints': 512.0,
 'mnum_matches': 244.0,
 'mprec@1px': 0.205,
 'mprec@3px': 0.505,
 'mransac_inl': 118.0,
 'mransac_inl%': 0.498}

Here is my conf file:

data:
    name: homographies
    data_dir: revisitop1m
    train_size: 150000
    val_size: 2000
    batch_size: 128
    num_workers: 16
    homography:
        difficulty: 0.5
        max_angle: 45
    photometric:
        name: lg
model:
    name: two_view_pipeline
    extractor:
        name: extractors.xfeat
        max_num_keypoints: 512
        detection_threshold: 0.05
        trainable: False
    ground_truth:
        name: matchers.homography_matcher
        th_positive: 3
        th_negative: 3
    matcher:
        name: matchers.lightglue
        filter_threshold: 0.1
        flash: true
        checkpointed: true
        input_dim: 64
        descriptor_dim: 96
        n_layers: 6
        num_heads: 1
train:
    seed: 0
    epochs: 40
    log_every_iter: 100
    eval_every_iter: 500
    lr: 1e-4
    lr_schedule:
        start: 20
        type: exp
        on_epoch: true
        exp_div_10: 10
    plot: [5, 'gluefactory.visualization.visualize_batch.make_match_figures']
benchmarks:
    hpatches:
      eval:
        estimator: poselib
        ransac_th: [0.5, 1.0, 1.5, 2.0, 2.5, 3.0]

And I utilized the DetectAndCompute pipeline from the provided source code as the _forward function within my extractor/xfeat implementation.

Could you share your modified conf file and extractor/xfeat.py code file? Seeing how you've set up the xfeat extractor would be really useful.

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

1 participant