-
Notifications
You must be signed in to change notification settings - Fork 861
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 SIFT GPU support #623
base: main
Are you sure you want to change the base?
Add SIFT GPU support #623
Conversation
added new class (sift_gpu.py) for sift_gpu detection and matching.
# Conflicts: # .gitignore
change the dependency on csfm
Update features.py
change the gitignore to be the original one
fixed minor mistake
Sift gpu v0.4.0
Sift gpu v0.4.0
change the import of sift_gpu
Hi @cojosef96 ! Thank you for your PR, it's great to try to speed-up the OpenSfM pipeline by introducing GPU image processing. This has been requested quite sometimes by people over the years. As it is now, the PR would add a bit of code duplication that seems not needed. It would be better if :
Let me know if you can rework this, or when we'll find some time, we can also do the changes on our side. Yann |
While I appreciate GPU support for OpenSfM, I am not sure that this PR is structurally suited to be the way to go. It adds yet another dependency to an already over boarding long list of OpenSfM's dependencies. If anything the SIFT GPU extractor should be a weak dependency (hence plug-in like). |
Hey, @YanNoun
|
Hey, @gitne |
I know, I am aware of that. And, I am also all for GPU support. So, this is not the point. The point with your current implementation is that one cannot run OpenSfM unless one also has the Silx dependency, even if one configures OpenSfM to use a pure CPU or pure Python features extractor. Python's import system requires one to satisfy the So what I am saying is that |
bin/opensfm_run_all
Outdated
@@ -3,7 +3,7 @@ | |||
set -e | |||
|
|||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |||
PYTHON=${2:-python3} | |||
PYTHON=python2.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not look right. Looks like debug stuff.
bin/opensfm_run_all
Outdated
$PYTHON $DIR/opensfm undistort $1 | ||
$PYTHON $DIR/opensfm compute_depthmaps $1 | ||
#$PYTHON $DIR/opensfm undistort $1 | ||
#$PYTHON $DIR/opensfm compute_depthmaps $1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like debug stuff too.
Hi guys, not sure about your timings here but as part of a GSoC project, by the end of the summer OpenCV is going to introduce back sift to the main repo after its patent expiration. |
@edgarriba Do you know if OpenCV's implementation is also going to have GPU support? |
…atching.py process to support GPU_Matching
…xternal functions. added conversion function from pos, desc to GPU keypoints meaning we can now run gpu matching with different features, not only SIFT_GPU features. Tested Import Error of Silx.
Sift gpu v0.4.0
Hey, |
So far, looks great to me. 66168c3 |
Hey 👋 all, noticed this PR. I've also been researching ways to add GPU support to OpenSfM. So far I've only added the feature detection part, but the work I started on this repository https://github.com/uav4geo/pypopsift/ can be used to swap the SIFT feature extractor. pierotofy@00bb120 It's a WIP and performance is not ideal though. |
changed the requirements and returned the original opensfm_run_all file
Hey, I fixed all the issues noted above. I hope that this PR will be helpful to you. |
Hi @cojosef96 , I reworked a bit your branch here : master...feat-polish-sift-gpu
After benchmarking on a 16-inches Macbook (16 logical cores), feature extraction is 2x faster, but matching is much slower than the CPU-16-cores one. Let me know what you think of the following changes. Yann |
Hey @YanNoun ,
About the running on Mac:
This parallel problem can be fixed by demanding 1 process when using GPU functions. I hope you will be able to merge the GPU implementation to the master repository. Best Regards, |
Hi @cojosef96! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Hey, |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
It's worth pointing out that feature extraction using the proposed GPU method does not account for Feature extraction is nonetheless quite fast using the GPU, if Feature matching speed can be improved a bit if one removes the code to load the image data ( |
Is there going to be a merge in the near future? I think many people are waiting for this to be in an official release. |
@cojosef96 you might consider using kornia implementation (based on pytorch) or even more powerful features like HardNet /cc @ducha-aiki |
Temporarily you can also check out this fork/branch https://github.com/OpenDroneMap/OpenSfM/tree/261 that has GPU support merged (mostly adapted from this PR). |
@pierotofy would https://github.com/OpenDroneMap/OpenSfM/tree/261 make this PR obsolete? Would it make sense to close this PR and open yours? |
No, |
This PR adds SIFT GPU feature detection and matching to improve performance drastically with GPU.