Skip to content

Commit e5bc1cc

Browse files
author
bmild
committed
fixed gamma again, tweak makefiles
1 parent 582b9ea commit e5bc1cc

File tree

8 files changed

+30
-6
lines changed

8 files changed

+30
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.ipynb_checkpoints*
2+
*.pyc

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ General usage (in `opengl_viewer/` directory) is
222222

223223
- __`PyramidCU::GenerateFeatureList: an illegal memory access was encountered`__:
224224
Some machine configurations might run into problems running the script `imgs2poses.py`.
225-
A solution to that would be to set the environment variable `CUDA_VISIBLE_DEVICES`.
225+
A solution to that would be to set the environment variable `CUDA_VISIBLE_DEVICES`. If the issue persists, try uncommenting [this line](https://github.com/Fyusion/LLFF/blob/master/llff/poses/colmap_wrapper.py#L33) to stop COLMAP from using the GPU to extract image features.
226226
- __Black screen__:
227-
In the latest versions of MacOS, OpenGL initializes a context with a black screen until one drag or resize the window. If you run into this probblem, please drag the window to another position.
227+
In the latest versions of MacOS, OpenGL initializes a context with a black screen until the window is dragged or resized. If you run into this probblem, please drag the window to another position.
228228

229229

230230
## Citation

cuda_renderer/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
all: main.cu mpi_cuda.cu
1+
cuda_renderer: main.cu mpi_cuda.cu
22
nvcc -ccbin g++ -std=c++11 -m64 -I. \
33
main.cu mpi_cuda.cu -o cuda_renderer
44

llff/poses/colmap_wrapper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def run_colmap(basedir):
3030
'--database_path', os.path.join(basedir, 'database.db'),
3131
'--image_path', os.path.join(basedir, 'images'),
3232
'--ImageReader.single_camera', '1',
33+
# '--SiftExtraction.use_gpu', '0',
3334
]
3435
feat_output = ( subprocess.check_output(feature_extractor_args, universal_newlines=True) )
3536
logfile.write(feat_output)

llff/poses/pose_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,14 @@ def load_data(basedir, factor=None, width=None, height=None, load_imgs=True):
236236
if not load_imgs:
237237
return poses, bds
238238

239-
imgs = [imageio.imread(f, ignoregamma=True)[...,:3]/255. for f in imgfiles]
239+
# imgs = [imageio.imread(f, ignoregamma=True)[...,:3]/255. for f in imgfiles]
240+
def imread(f):
241+
if f.endswith('png'):
242+
return imageio.imread(f, ignoregamma=True)
243+
else:
244+
return imageio.imread(f)
245+
246+
imgs = imgs = [imread(f)[...,:3]/255. for f in imgfiles]
240247
imgs = np.stack(imgs, -1)
241248

242249
print('Loaded image data', imgs.shape, poses[:,-1,0])

opengl_viewer/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ifeq ($(UNAME), Darwin)
77
FLAGS = -framework OpenGl -framework Cocoa -framework IOKit -framework CoreVideo -lglfw3
88
endif
99

10-
all: glad.c viewer.cpp
10+
opengl_viewer: glad.c viewer.cpp
1111
g++ glad.c viewer.cpp -o opengl_viewer -I. -std=c++11 $(FLAGS)
1212

1313
clean:

scenedir2mpis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mkdir -p $1/outputs
22
python imgs2poses.py $1
33
python imgs2mpis.py $1 $1/mpis_$2 --height $2
4-
python imgs2renderpath.py $1 $1/outputs/test_path.txt
4+
python imgs2renderpath.py $1 $1/outputs/test_path.txt
55
cuda_renderer/cuda_renderer $1/mpis_$2 $1/outputs/test_path.txt $1/outputs/test_vid.mp4 -1 .8 18

vid2mpis.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### Automatically extracts a frame every half second to use for creating MPIs
2+
3+
# export CUDA_VISIBLE_DEVICES=0
4+
mkdir -p $2
5+
mkdir -p $2/images
6+
mkdir -p $2/outputs
7+
# unzip -j $1 -d $2/images
8+
ffmpeg -i $1 -vf fps=2 $2/images/img%03d.png
9+
python imgs2poses.py $2
10+
python imgs2mpis.py $2 $2/mpis_$3 --height $3
11+
python imgs2renderpath.py $2 $2/outputs/test_path.txt --spiral
12+
cd cuda_renderer && make && cd ..
13+
cuda_renderer/cuda_renderer $2/mpis_$3 $2/outputs/test_path.txt $2/outputs/test_vid.mp4 -1 .8 18
14+
# python mpis2video.py $2/mpis_$3 $2/outputs/test_path.npy $2/outputs/test_vid.mp4 --crop_factor .8

0 commit comments

Comments
 (0)