Skip to content

Commit d14aa17

Browse files
authored
Merge pull request #104 from alicevision/dev/fixTestingPaths
Dev/fix testing paths
2 parents b23338e + 309e1a3 commit d14aa17

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ option(PopSift_ERRCHK_AFTER_KERNEL "Synchronize and check CUDA error after e
1313
option(PopSift_USE_POSITION_INDEPENDENT_CODE "Generate position independent code." ON)
1414
option(PopSift_USE_GRID_FILTER "Switch off grid filtering to massively reduce compile time while debugging other things." ON)
1515
option(PopSift_USE_NORMF "The __normf function computes Euclidean distance on large arrays. Fast but stability is uncertain." OFF)
16-
option(PopSift_USE_TEST_CMD "Add testing step for functional verification" OFF)
1716
option(PopSift_NVCC_WARNINGS "Switch on several additional warning for CUDA nvcc" OFF)
17+
option(PopSift_USE_TEST_CMD "Add testing step for functional verification" OFF)
1818
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
1919

20-
2120
if(PopSift_USE_POSITION_INDEPENDENT_CODE AND NOT MSVC)
2221
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2322
endif()
@@ -201,7 +200,13 @@ endif()
201200

202201
add_subdirectory(src)
203202

203+
set(PopSift_TESTFILE_PATH "popsift-samples/datasets/sample/big_set/" CACHE STRING "Base directory where your test files are stored")
204204
if(PopSift_USE_TEST_CMD)
205+
if(NOT IS_ABSOLUTE("${PopSift_TESTFILE_PATH}"))
206+
get_filename_component(PopSift_TESTFILES "${PopSift_TESTFILE_PATH}" ABSOLUTE)
207+
set(PopSift_TESTFILE_PATH "${PopSift_TESTFILES}")
208+
endif()
209+
205210
add_subdirectory(testScripts)
206211
endif()
207212

@@ -228,9 +233,12 @@ message(STATUS "Generate position independent code: " ${CMAKE_POSITION_INDEPENDE
228233
message(STATUS "Use CUDA NVTX for profiling: " ${PopSift_USE_NVTX_PROFILING})
229234
message(STATUS "Synchronize and check CUDA error after every kernel: " ${PopSift_ERRCHK_AFTER_KERNEL})
230235
message(STATUS "Grid filtering: " ${PopSift_USE_GRID_FILTER})
231-
message(STATUS "Testing step: " ${PopSift_USE_TEST_CMD})
232236
message(STATUS "Additional warning for CUDA nvcc: " ${PopSift_NVCC_WARNINGS})
233237
message(STATUS "Compiling for CUDA CCs: ${PopSift_CUDA_CC_LIST}")
234238
message(STATUS "Install path: " ${CMAKE_INSTALL_PREFIX})
239+
message(STATUS "Testing step: " ${PopSift_USE_TEST_CMD})
240+
if(PopSift_USE_TEST_CMD)
241+
message(STATUS "Path for test input: " ${PopSift_TESTFILE_PATH})
242+
endif()
235243
message("\n******************************************")
236244
message("\n")

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ PopSift tries to stick as closely as possible to David Lowe's famous paper [1],
1111

1212
PopSift compiles and works with NVidia cards of compute capability >= 3.0 (including the GT 650M), but the code is developed with the compute capability 5.2 card GTX 980 Ti in mind.
1313

14+
CUDA SDK 11 does no longer support compute capability 3.0. 3.5 is still supported with deprecation warning.
15+
1416
## Dependencies
1517

1618
PopSift depends on:

testScripts/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/testOxfordDataset.sh.in
55
${CMAKE_CURRENT_BINARY_DIR}/testOxfordDataset.sh )
66

77
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/TEST.sh.in
8-
${CMAKE_CURRENT_BINARY_DIR}/TEST.sh )
8+
${CMAKE_CURRENT_BINARY_DIR}/TEST.sh )
99

1010
add_custom_target(
1111
prepare-test

testScripts/TEST.sh.in

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#!/bin/bash
22

3-
# IMAGE=../../popsift-samples/sample/big_set/boat/img2.ppm
4-
IMAGE=../../popsift-samples/sample/big_set/boat/img3.ppm
5-
# IMAGE=./test-17x17.pgm
3+
IMAGE=@PopSift_TESTFILE_PATH@/boat/img3.ppm
64

7-
POPSIFT_DEMO_BIN=@EXECUTABLE_OUTPUT_PATH@/popsift-demo
5+
POPSIFT_DEMO_BIN=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/popsift-demo
86

97
LOG=--log
108
# LOG=
@@ -18,8 +16,8 @@ FILTER="--filter-max-extrema=2000 --filter-grid=2 --filter-sort=down"
1816

1917
PARAMS="$LOG $GAUSS_MODE $SCALING $FILTER --popsift-mode --octaves=8 --threshold=0.04 --edge-threshold=10.0 --initial-blur=0.5"
2018

21-
for mode in loop ; do
22-
# for mode in loop grid igrid notile ; do
19+
# for mode in loop ; do
20+
for mode in loop grid igrid notile ; do
2321
# for mode in igrid notile ; do
2422
echo "MODE: $mode"
2523
echo "$POPSIFT_DEMO_BIN $PARAMS --desc-mode=$mode --write-as-uchar --norm-multi=9 -i $IMAGE"
@@ -73,4 +71,3 @@ echo -n "grid vs notile: "
7371
echo -n "igrid vs notile: "
7472
~/GIT/github/popsift-samples/playground/build/compare-descfiles \
7573
-q output-features-igrid.txt output-features-notile.txt
76-

testScripts/testOxfordDataset.sh.in

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ do
3030
cd $dataset
3131
for img in img1 img2 img3 img4 img5 img6
3232
do
33-
if [ -f @CMAKE_SOURCE_DIR@/oxford/$dataset/$img.pgm ]
33+
if [ -f @PopSift_TESTFILE_PATH@/$dataset/$img.pgm ]
3434
then
35-
imgfile=@CMAKE_SOURCE_DIR@/oxford/$dataset/$img.pgm
36-
elif [ -f @CMAKE_SOURCE_DIR@/oxford/$dataset/$img.ppm ]
35+
imgfile=@PopSift_TESTFILE_PATH@/$dataset/$img.pgm
36+
elif [ -f @PopSift_TESTFILE_PATH@/$dataset/$img.ppm ]
3737
then
38-
imgfile=@CMAKE_SOURCE_DIR@/oxford/$dataset/$img.ppm
38+
imgfile=@PopSift_TESTFILE_PATH@/$dataset/$img.ppm
3939
else
4040
continue
4141
fi
@@ -45,7 +45,7 @@ do
4545
echo "Directory output-$img exists. Skipping."
4646
continue
4747
fi
48-
@EXECUTABLE_OUTPUT_PATH@/popsift-demo --log --gauss-mode vlfeat --desc-mode loop --popsift-mode --root-sift --downsampling -1 -i $imgfile
48+
@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/popsift-demo --log --gauss-mode vlfeat --desc-mode loop --popsift-mode --root-sift --downsampling -1 -i $imgfile
4949
if [ $? != 0 ]
5050
then
5151
echo "Running popsift on $imgfile failed."
@@ -157,4 +157,3 @@ do
157157
fi
158158
done
159159
done
160-

0 commit comments

Comments
 (0)