-
Notifications
You must be signed in to change notification settings - Fork 658
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
feat(localization): add nerf_based_localizer
#5312
feat(localization): add nerf_based_localizer
#5312
Conversation
Signed-off-by: Shintaro Sakoda <[email protected]>
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.
Awesome! 🎉
This pull request will create a new dependency on libtorch, so it is difficult to know how to handle that. I think it could be rejected and closed. It is important that once it went out as a pull request and was discussed. I have not yet fixed spell check, linter, etc., but if there is a chance that the merge will be possible, I will do. |
@SakodaShintaro I think that's a reasonable speculation. IMHO it seems OK since CMake won't be built as long as libtorch is not found, but how about creating a Discussion or ask perception team internally? |
In my environment, the build failed due to __device__ float atomicAdd(__half * a, float b)
{
bool uplo =
((unsigned long long)a) &
2; // check if the atomic is for the upper or lower 16-bit quantity in the aligned 32-bit item
unsigned * addr = reinterpret_cast<unsigned *>(
((unsigned long long)a) & 0xFFFFFFFFFFFFFFFCULL); // get the 32-bit aligned address
unsigned old = *addr;
unsigned val;
do {
val = old;
float newval = __half2float(__ushort_as_half(
uplo ? ((unsigned short)(val >> 16)) : ((unsigned short)(val)))) +
b;
unsigned short newval_s = __half_as_ushort(__float2half(newval));
unsigned newval_u = val & (uplo ? (0x0FFFFU) : (0xFFFF0000U));
newval_u |= uplo ? (((unsigned)newval_s) << 16) : (newval_s);
old = atomicCAS(addr, old, newval_u);
} while (old != val);
return __half2float(__ushort_as_half(uplo ? (old >> 16) : (old)));
} |
In my GPU, I could not run it at 1x speed with the default settings, but it surely performs localization! 👏 |
The problem about atomicAdd may be described in the following page.
https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#atomicadd It may be possible to speed up the process by changing the following constant from 1024 to 512, but I will try this later as I suspect there are other variables that will need to be changed if this is changed.
|
My GPU is a GeForce GTX 1080ti with compute capability 6.1, and it seems like
This is the result in my environment.
Exposing MAX_SAMPLE_PER_RAY as a YAML file would be convenient for users. 🙏 |
Signed-off-by: Shintaro SAKODA <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
Fixed so that
Accuracy is somewhat reduced, but speed is improved. |
Wonderful work!. Is there some reference paper about this nerf-based localization methods? |
@Gatsby23 NeRF PartThe code added in this pull request is primarily based on the implementation of F2-NeRF. You can find more information here: https://totoro97.github.io/projects/f2-nerf/ F2-NeRF can be summarized as Instant-NGP enhanced with spatial partitioning via Octree and Warping. However, this pull request omits the spatial partitioning and Warping using Octree, a key innovation of F2-NeRF, due to the following two drawbacks:
NeRF-based Localization PartThis pull request supports two methods of using NeRF for self-localization:
Neither is a complete reproduction of the paper, but rather a reference of ideas. I hope this information will help you. |
That's really impressive. Beacuase two of the reference paper is worked at a small space. It's really interesting it can worked on a large environment. |
Thank you very much. However, it can be said that this method is still in the validation stage, as it has not been fully evaluated to see if it can cover such a large area as a huge city. NeRF and Gaussian Splatting have developed remarkably in recent years, and there is a possibility that their performance will be enhanced by incorporating methods such as neuralsim and DrivingGaussian. I look forward to further developments in this area. |
…nto feat/add_nerf_initializer
Signed-off-by: Shintaro SAKODA <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
feat: add initializer to nerf
Signed-off-by: Shintaro Sakoda <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
set_ray_batch_size
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
…nto feat/make_set_ray_batich_size
feat: make set ray batich size
Signed-off-by: Shintaro Sakoda <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
This pull request has been automatically marked as stale because it has not had recent activity. |
In recent years, techniques such as 3D Gaussian Splatting have emerged, and we believe it would be better to start implementing it with offline tools rather than starting with the Autoware runtime, so we are closing this pull request. |
Description
Add the NeRF Based Localizer package.
nerf_result_movie.mp4
See README for details
https://github.com/SakodaShintaro/autoware.universe/tree/feat/add_nerf_based_localizer/localization/nerf_based_localizer
Tests performed
It has been confirmed that
logging_simulator
works with the trained data and rosbag shown in README.md.A quantitative comparison in rosbag for
ar_tag_based_localizer
is shown in the table below.Effects on system behavior
It does not affect autoware unless you download libtorch properly.
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.