Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
instant-ngp-tomography
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Pickles
instant-ngp-tomography
Commits
69d34ad8
Commit
69d34ad8
authored
2 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
Fix race condition in `nerf_loader.cu`, leading to erroneous behavior with multiple json files
parent
14d6ba6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nerf_loader.cu
+4
-4
4 additions, 4 deletions
src/nerf_loader.cu
with
4 additions
and
4 deletions
src/nerf_loader.cu
+
4
−
4
View file @
69d34ad8
...
@@ -415,8 +415,8 @@ NerfDataset load_nerf(const std::vector<filesystem::path>& jsonpaths, float shar
...
@@ -415,8 +415,8 @@ NerfDataset load_nerf(const std::vector<filesystem::path>& jsonpaths, float shar
fs
::
path
basepath
=
jsonpaths
[
i
].
parent_path
();
fs
::
path
basepath
=
jsonpaths
[
i
].
parent_path
();
std
::
string
jp
=
jsonpaths
[
i
].
str
();
std
::
string
jp
=
jsonpaths
[
i
].
str
();
auto
lastdot
=
jp
.
find_last_of
(
'.'
);
if
(
lastdot
==
std
::
string
::
npos
)
lastdot
=
jp
.
length
();
auto
lastdot
=
jp
.
find_last_of
(
'.'
);
if
(
lastdot
==
std
::
string
::
npos
)
lastdot
=
jp
.
length
();
auto
lastunderscore
=
jp
.
find_last_of
(
'_'
);
if
(
lastunderscore
==
std
::
string
::
npos
)
lastunderscore
=
lastdot
;
else
lastunderscore
++
;
auto
lastunderscore
=
jp
.
find_last_of
(
'_'
);
if
(
lastunderscore
==
std
::
string
::
npos
)
lastunderscore
=
lastdot
;
else
lastunderscore
++
;
std
::
string
part_after_underscore
(
jp
.
begin
()
+
lastunderscore
,
jp
.
begin
()
+
lastdot
);
std
::
string
part_after_underscore
(
jp
.
begin
()
+
lastunderscore
,
jp
.
begin
()
+
lastdot
);
if
(
json
.
contains
(
"enable_ray_loading"
))
{
if
(
json
.
contains
(
"enable_ray_loading"
))
{
...
@@ -534,7 +534,7 @@ NerfDataset load_nerf(const std::vector<filesystem::path>& jsonpaths, float shar
...
@@ -534,7 +534,7 @@ NerfDataset load_nerf(const std::vector<filesystem::path>& jsonpaths, float shar
}
}
}
}
if
(
json
.
contains
(
"frames"
)
&&
json
[
"frames"
].
is_array
())
pool
.
parallelForAsync
<
size_t
>
(
0
,
json
[
"frames"
].
size
(),
[
&
,
basepath
,
image_idx
,
info
](
size_t
i
)
{
if
(
json
.
contains
(
"frames"
)
&&
json
[
"frames"
].
is_array
())
pool
.
parallelForAsync
<
size_t
>
(
0
,
json
[
"frames"
].
size
(),
[
&
progress
,
&
n_loaded
,
&
result
,
&
images
,
&
json
,
basepath
,
image_idx
,
info
,
rolling_shutter
,
principal_point
,
camera_distortion
,
part_after_underscore
,
fix_premult
,
enable_depth_loading
,
enable_ray_loading
](
size_t
i
)
{
size_t
i_img
=
i
+
image_idx
;
size_t
i_img
=
i
+
image_idx
;
auto
&
frame
=
json
[
"frames"
][
i
];
auto
&
frame
=
json
[
"frames"
][
i
];
LoadedImageInfo
&
dst
=
images
[
i_img
];
LoadedImageInfo
&
dst
=
images
[
i_img
];
...
@@ -652,7 +652,7 @@ NerfDataset load_nerf(const std::vector<filesystem::path>& jsonpaths, float shar
...
@@ -652,7 +652,7 @@ NerfDataset load_nerf(const std::vector<filesystem::path>& jsonpaths, float shar
}
}
nlohmann
::
json
&
jsonmatrix_start
=
frame
.
contains
(
"transform_matrix_start"
)
?
frame
[
"transform_matrix_start"
]
:
frame
[
"transform_matrix"
];
nlohmann
::
json
&
jsonmatrix_start
=
frame
.
contains
(
"transform_matrix_start"
)
?
frame
[
"transform_matrix_start"
]
:
frame
[
"transform_matrix"
];
nlohmann
::
json
&
jsonmatrix_end
=
frame
.
contains
(
"transform_matrix_end"
)
?
frame
[
"transform_matrix_end"
]
:
jsonmatrix_start
;
nlohmann
::
json
&
jsonmatrix_end
=
frame
.
contains
(
"transform_matrix_end"
)
?
frame
[
"transform_matrix_end"
]
:
jsonmatrix_start
;
if
(
frame
.
contains
(
"driver_parameters"
))
{
if
(
frame
.
contains
(
"driver_parameters"
))
{
Eigen
::
Vector3f
light_dir
(
Eigen
::
Vector3f
light_dir
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment