3DOM-FBK / deep-image-matching

Multiview matching with deep-learning and hand-crafted local features for COLMAP and other SfM software. Supports high-resolution formats and images with rotations. Both CLI and GUI are supported.
https://3dom-fbk.github.io/deep-image-matching/
BSD 3-Clause "New" or "Revised" License
294 stars 31 forks source link

Running error #35

Closed oUp2Uo closed 5 months ago

oUp2Uo commented 5 months ago

Hi,

After done installation by document, I tried the first step to run help and got this error: (Running on Win10)

(deep-image-matching) C:\Users\Up2U\Desktop\deep-image-matching\deep-image-matching>python main.py --help
*** Aborted at 1706143103 (unix time) try "date -d @1706143103" if you are using GNU date ***
    @     0x7ff9e6f10ef5 _seh_filter_exe
    @     0x7ff6187a2408 (unknown)
    @     0x7ff9e55de390 __C_specific_handler
    @     0x7ff9e98723af __chkstk
    @     0x7ff9e98214b4 RtlRaiseException
    @     0x7ff9e9870ebe KiUserExceptionDispatcher
    @     0x7ff9b45126de void __cdecl __ExceptionPtrRethrow(void const * __ptr64)
    @     0x7ff95e958f8e public: void __cdecl c10::ivalue::Future::markCompleted(void) __ptr64
    @     0x7ff95ece6b02 struct _object * __ptr64 __cdecl THPGenerator_initDefaultGenerator(struct at::Generator)
    @     0x7ff978e5de65 (unknown)
    @     0x7ff9793bd389 PyInit_pycolmap
    @     0x7ff9d2e11080 (unknown)
    @     0x7ff9d2e126b5 __NLG_Return2
    @     0x7ff9e9871716 RtlCaptureContext2
    @     0x7ff978e60961 (unknown)
    @     0x7ff99c98f0ee _PyArg_ParseTuple_SizeT
    @     0x7ff99c919b3d _PyObject_MakeTpCall
    @     0x7ff99caa2eb6 _PyErr_FormatFromCauseTstate
    @     0x7ff99c92b723 _PyObject_GenericGetAttrWithDict
    @     0x7ff99c92c280 PyObject_GetAttr
    @     0x7ff99c971229 PyObject_GetAttrString
    @     0x7ff978e96cae PyInit_pycolmap
    @     0x7ff978ef3796 PyInit_pycolmap
    @     0x7ff978ec9aad PyInit_pycolmap
    @     0x7ff978e854a3 (unknown)
    @     0x7ff978e91fc8 PyInit_pycolmap
    @     0x7ff978e91ace PyInit_pycolmap
    @     0x7ff99c94c53c PyImport_GetModuleDict
    @     0x7ff99c94c796 PyImport_GetModuleDict
    @     0x7ff99c94c6f1 PyImport_GetModuleDict
    @     0x7ff99c9242e7 PyType_GenericAlloc
    @     0x7ff99c9136e4 PyVectorcall_Call

Thank you.

franioli commented 5 months ago

Hi, yes we have faced the same issue. It's a problem related to pycolmap on windows. Pycolmap 0.5.0 is installed correctly by pip and you can import it, but when you call the reconstruction module, pycolmap throws this error (this is why we have not included pycolmap in deep-image-matching dependencies yet).

My suggestions are:

oUp2Uo commented 5 months ago

Thanks for your reply.

I have checked my pycolmap version and it is 0.6.0 (because I did the installation yesterday). After I uninstalled pycolmap, main.py could run now.

The console print says Not possible to read exif data. Loading only image size... I have checked the photos, and they all have EXIF information. Is this because no pycolmap?

Thank you.

lcmrl commented 5 months ago

Not possible to read exif data. Loading only image size.. is only a warning but the code will run fine anyway. Could you sand an image to understand why the exif are not read properly?

oUp2Uo commented 5 months ago

Yes, I have done one dataset which cannot go fine with SIFT. But superpoint+superglue goes well. Thanks for this great work ! I have tried for a long time to replace SIFT with superpoint, but I could not finish it. Until this week I found this project.

About EXIF information, I could see them in the file property. capture So I think the photo has EXIF information. But there was the warning Not possible to read exif data. Loading only image size... It will only matters the actual size/length (extrinsics) and not a big problem.

lcmrl commented 5 months ago

Could you check if in the Details section there are the dimensions?

image

oUp2Uo commented 5 months ago

Thanks for the reply.

Yes, I have checked this property, they are there.

I have done some more tests and found some points: If I use the original photos (8K size), there are no warnings, but my PC memory is not enough to do the calculation. If I use the photos downscaled by PhotoShop (2K size, have EXIF infomation), there are warnings. Here is the comparison of the two images. (Sorry with the Chinese characters, but I think it is not hard to see the properties) comparison

lcmrl commented 5 months ago

Hi, probably photoshop has changed the name of some tags and the library to read the exif does not load it correctly. In any case, this does not affect the correct functioning of the software. Thank you for your feedback, we will enrich the warning information!

About image size, to process your dataset you have two options:

Thanks for the feedback, please feel free to reopen the issue or open a new one

oUp2Uo commented 5 months ago

Thanks for the reply! I have see the document of tiling and match option. I will have a try on large images.

Lynx5261 commented 3 months ago

I ran into the same issue with Pycolmap. However, when using a different codebase I am able to use Pycolmap just fine.

What I noticed when debugging a bit is that the real issue is that pytorch is imported prior to Pycolmap. When importing Pycolmap before torch, your kernel lives happily ever after!

SOLUTION: ==> adapt "image_matching.py" ... import h5py import numpy as np import pycolmap # import pycolmap here already, prior to importing torch to avoid compatibility issues import torch from tqdm import tqdm ...

lcmrl commented 3 months ago

Thanks, this solve the problem on windows! I have pushed the suggestion on dev branch, next week I hope we will merge dev in master and have a new release. If you have any other issue feel free to open an issue or free to collaborate!