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

Add core dependencies installation script #80

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

ovysotska
Copy link

This PR adds a script to pull and install all core dependencies needed for the LaMAR.
Warning, the C++ dependencies will be installed system wide.

This PR also:

  • downgrades the version of pycolmap for compatibility issues with COLMAP 3.8.
  • downgrades the numpy version in scantools for compatibility with the numpy version of LaMAR.
  • adds dependency for scikit-learn because HLOC 1.4 requires it

@ovysotska
Copy link
Author

@microsoft-github-policy-service agree

@pablospe
Copy link
Contributor

pablospe commented Nov 8, 2024

Thanks! There are some scripts in the docker/scripts directory that might be helpful to you as well. I am considering moving these scripts outside of the docker/ folder for better organization. Additionally, I need to ensure that the script in this PR works properly within the Docker image.

If you look at the Dockerfile, you'll notice it is similar to your script. The complexity arises because we have different stages: common, scantools, lamar, etc. I also aimed to avoid including development-only dependencies to prevent creating large images.

One question. Have you tried with the lamar image (here)? This supposed to install all the dependencies. I was wondering if having the new pycolmap version breaks the pipeline, in that case I could apply some of your changes in the Dockerfile to return to the old one.

@mihaidusmanu
Copy link
Collaborator

mihaidusmanu commented Nov 8, 2024

Thanks a lot for the contribution @ovysotska !

The docker image is not fully functional either as some calls to pycolmap in this pipeline are not compatible with 0.6.0.
That package should be downgraded in any case (or someone should make a full run over the pipeline to fix all the compatibility issues with 0.6.0 but that is imo out of scope for this PR).

I think it's better if users can also install from scratch without needing docker so having a dedicated script for local setup would be a good thing.

README.md Outdated Show resolved Hide resolved
@ovysotska
Copy link
Author

ovysotska commented Nov 11, 2024

@pablospe thanks for the comment.

I checked the docker/scripts you recommend. They seems to provide instructions to installing hloc and dev dependencies.
In this PR, I am proposing to install the 'core dependencies' such that pcd meshing and raybender are not the part of the script. So hopefully, addressing your concerns here.

About the docker image, yes I tried building it. The building part seemed to work :) at least there were no obvious errors.
Unfortunately, I don't know what to do next with it. The readme doesn't tell how to use this image to run laMAR 😢
I tried creating a container with this image, however, it just did nothing.
If you could add some instructions how to use that image, that would be great 😄 and I could try that out too.

Thanks!

@pablospe
Copy link
Contributor

In this PR, I am proposing to install the 'core dependencies' such that pcd meshing and raybender are not the part of the script.

Ok, I see. Anyways I would like to split this script in several scripts that could be reusable also in the Dockerfile. I will do/propose some changes to this PR, but essentially the same code. Thanks for the contribution!

@pablospe
Copy link
Contributor

@ovysotska
In case you have time, could you check if this is working for you? I tested inside docker, ubuntu 22.04. I will also test it inside ubuntu 24.04 later.

@ovysotska
Copy link
Author

I will try but now I have a question. Do I need to create my own virtual environment, for example through venv before calling .install_core_dependencies.sh script?

@pablospe
Copy link
Contributor

I will try but now I have a question. Do I need to create my own virtual environment, for example through venv before calling .install_core_dependencies.sh script?

Yes, if you want to install the python packages in a new environment. Otherwise, it will install them in the user's default one.

@pablospe
Copy link
Contributor

.install_core_dependencies.sh script

Notice that now all the bash scripts are in scripts/ folder. Then, scripts/install_core_dependencies.sh for running it.

Dockerfile Outdated Show resolved Hide resolved
Comment on lines 11 to 13
pip wheel --no-deps -w dist-wheel .
whl_path=$(find dist-wheel/ -name "*.whl")
echo $whl_path >dist-wheel/whl_path.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually work? This would package hloc without the feature extractors/matchers, which are outside the Python package. We generally build with the -e option and can't turn this into a wheel.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for point this out!

This separation into builder and runtime Docker image stages was done to exclude development dependencies from the runtime image, thus reducing the overall image size. It appears to be built this way, but I need to verify what you're saying. I didn't actually use the Lamar image but rather the Scantools one.

Notice that the script introduced in this PR (which installs it locally) doesn't use this method. Instead, it directly runs:
python3 -m pip install git+https://github.com/cvg/[email protected]
Therefore, this issue only affects the Docker image.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be resolved in the last commit. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment also holds for this installation command, since pip only retains the package files in hloc/ and discards all dependencies that are in third_party/. Only features/matchers pulled via pip (so DISK, ALIKED, LightGlue, and the image retrieval features) will be available then. I will fix this at some point but it's a low priority on my end.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks again. I will fix it soon.

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

Successfully merging this pull request may close these issues.

4 participants