forked from NVlabs/instant-ngp
-
Notifications
You must be signed in to change notification settings - Fork 76
/
NeRF.bat
82 lines (58 loc) · 1.71 KB
/
NeRF.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@echo off
set title=NeRF
title %title%
set dir=data
echo 1) New Project
echo 2) Render Scene
echo 3) Load Snapshop
choice /c 123 /n /m Choice:
echo.
if errorlevel 3 goto snap
if errorlevel 2 goto render
if errorlevel 1 goto new
:snap
title %title% - Load Snapshot
set /p snap=Snapshot path (*.msgpack):
build\testbed.exe --snapshot=%snap% -m nerf
title %title% - Finished
pause
exit
:render
title %title% - Render Scene
set /p project=Project folder name:
if not exist %dir%\%project% (exit)
if %project% == "" (exit)
echo.
set /p seconds=Seconds:
set /p fps=FPS:
set /p width=Res Width:
set /p height=Res Height:
echo.
call conda activate ngp
python scripts/render.py --scene %dir%\%project% --n_seconds %seconds% --fps %fps% --render_name %project% --width %width% --height %height%
rename %project%_test.mp4 %project%_render.mp4
title %title% - Finished
pause
exit
:new
title %title% - New Project
set path=%path%;%cd%\COLMAP
set /p project=Project folder name:
if not exist %dir%\%project%\%dir%\%project% (exit)
if %project% == "" (exit)
choice /n /c yn /m "Generate transforms? (y/n): "
echo.
if errorlevel 2 goto run
call conda activate ngp
python scripts\colmap2nerf.py --colmap_matcher exhaustive --run_colmap --aabb_scale 16 --images %dir%\%project%\%dir%\%project%
timeout 1
powershell -command "$dir = '%dir%\%project%\%dir%\%project%'; $dir = './' + $dir.replace('\', '\\\\') + '/'; (Get-Content transforms.json) -replace $dir, ('./' + '%dir%\%project%'.replace('\', '\\') + '/') | Out-File -encoding ASCII transforms.json;
del colmap.db
rmdir /s /q colmap_sparse
rmdir /s /q colmap_text
move transforms.json %dir%\%project%
:run
build\testbed.exe --scene %dir%\%project%
title %title% - Finished
pause
exit