tsattler / visuallocalizationbenchmark

342 stars 58 forks source link

import features fails #60

Closed Charlotte0592 closed 2 years ago

Charlotte0592 commented 2 years ago

Thanks for sharing the amaing benchmark! I have some promblems when I run:

python reconstruction_pipeline_aachen_v1_1.py 
    --dataset_path /local/aachen 
    --colmap_path /local/colmap/build/src/exe
    --method_name method

then, it happens:

Traceback (most recent call last):
  File "reconstruction_pipeline_aachen_v1_1.py", line 335, in <module>
    import_features(images, paths, args)
  File "reconstruction_pipeline_aachen_v1_1.py", line 164, in import_features
    cursor.execute("INSERT INTO keypoints(image_id, rows, cols, data) VALUES(?, ?, ?, ?);",
sqlite3.IntegrityError: UNIQUE constraint failed: keypoints.image_id

Does it means there are two or more same keypoints? Could please help me solve this problem?

tsattler commented 2 years ago

Can you provide more details on what you are trying to do? How do you obtain the features?

Charlotte0592 commented 2 years ago

According to Aachen v1.1 dataset, I wrote a images_list.TXT by myself and then used extract.py in R2D2 to extract local features, using the following command:

${PYTHONBIN} extract.py --model my_models/${LOCAL}.pt --images ${DATASETS_PATH}/images_list.txt --min-scale 0.3 --min-size 0 --max-size 9999 --top-k ${KPTS} --tag ${METHOD}

And I want to check whether my algorithm to extract local features is work, so I run

python reconstruction_pipeline_aachen_v1_1.py \
    --dataset_path ${DATASETS_PATH} \
    --colmap_path colmap \
    --method_name ${METHOD}

I want to use only local features to achieve visual localization, so I run this pipeline to obtain the queries' pose, in order to check whether my own algorithm is good. But I ran into the problem as described above. Could you please give some advice?

tsattler commented 2 years ago

The error sqlite3.IntegrityError: UNIQUE constraint failed: keypoints.image_id indicates that there are two images with the same image_id. I haven't seen this happening before though. Did you change anything else?