Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
instant-ngp-tomography
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Pickles
instant-ngp-tomography
Commits
6c4f7a6a
Commit
6c4f7a6a
authored
Jun 20, 2022
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
run.py: minor improvements
parent
6592f206
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/run.py
+33
-35
33 additions, 35 deletions
scripts/run.py
with
33 additions
and
35 deletions
scripts/run.py
+
33
−
35
View file @
6c4f7a6a
...
...
@@ -60,7 +60,6 @@ def parse_args():
args
=
parser
.
parse_args
()
return
args
if
__name__
==
"
__main__
"
:
args
=
parse_args
()
...
...
@@ -80,10 +79,6 @@ if __name__ == "__main__":
mode
=
ngp
.
TestbedMode
.
Sdf
configs_dir
=
os
.
path
.
join
(
ROOT_DIR
,
"
configs
"
,
"
sdf
"
)
scenes
=
scenes_sdf
elif
args
.
mode
==
"
volume
"
:
mode
=
ngp
.
TestbedMode
.
Volume
configs_dir
=
os
.
path
.
join
(
ROOT_DIR
,
"
configs
"
,
"
volume
"
)
scenes
=
scenes_volume
elif
args
.
mode
==
"
nerf
"
:
mode
=
ngp
.
TestbedMode
.
Nerf
configs_dir
=
os
.
path
.
join
(
ROOT_DIR
,
"
configs
"
,
"
nerf
"
)
...
...
@@ -92,6 +87,12 @@ if __name__ == "__main__":
mode
=
ngp
.
TestbedMode
.
Image
configs_dir
=
os
.
path
.
join
(
ROOT_DIR
,
"
configs
"
,
"
image
"
)
scenes
=
scenes_image
elif
args
.
mode
==
"
volume
"
:
mode
=
ngp
.
TestbedMode
.
Volume
configs_dir
=
os
.
path
.
join
(
ROOT_DIR
,
"
configs
"
,
"
volume
"
)
scenes
=
scenes_volume
else
:
raise
ValueError
(
"
Must specify either a valid
'
--mode
'
or
'
--scene
'
argument.
"
)
base_network
=
os
.
path
.
join
(
configs_dir
,
"
base.json
"
)
if
args
.
scene
in
scenes
:
...
...
@@ -303,7 +304,6 @@ if __name__ == "__main__":
print
(
f
"
Generating mesh via marching cubes and saving to
{
args
.
save_mesh
}
. Resolution=[
{
res
}
,
{
res
}
,
{
res
}
]
"
)
testbed
.
compute_and_save_marching_cubes_mesh
(
args
.
save_mesh
,
[
res
,
res
,
res
])
if
args
.
width
:
if
ref_transforms
:
testbed
.
fov_axis
=
0
testbed
.
fov
=
ref_transforms
[
"
camera_angle_x
"
]
*
180
/
np
.
pi
...
...
@@ -327,10 +327,8 @@ if __name__ == "__main__":
elif
args
.
screenshot_dir
:
outname
=
os
.
path
.
join
(
args
.
screenshot_dir
,
args
.
scene
+
"
_
"
+
network_stem
)
print
(
f
"
Rendering
{
outname
}
.png
"
)
image
=
testbed
.
render
(
args
.
width
,
args
.
height
,
args
.
screenshot_spp
,
True
)
image
=
testbed
.
render
(
args
.
width
or
1920
,
args
.
height
or
1080
,
args
.
screenshot_spp
,
True
)
if
os
.
path
.
dirname
(
outname
)
!=
""
:
os
.
makedirs
(
os
.
path
.
dirname
(
outname
),
exist_ok
=
True
)
write_image
(
outname
+
"
.png
"
,
image
)
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
sign in
to comment