Commit 85914150 authored by Cresson Remi's avatar Cresson Remi
Browse files

COMP: add some unit tests using 3 models (1-branch CNN, 2-branch CNN, 1-branch FCN)

parent 4547cbaf
otb_module_test() otb_module_test()
#set(IMAGEXS data/xs_subset.tif) # Directories
#set(IMAGEPAN data/pan_subset.tif) set(DATADIR ${CMAKE_CURRENT_SOURCE_DIR}/data)
#set(IMAGEPXS data/pxs_subset.tif) set(MODELSDIR ${CMAKE_CURRENT_SOURCE_DIR}/models)
#set(MODEL1 models/model1)
#set(MODEL2 models/model2) # Input images
#set(MODEL3 models/model3) set(IMAGEXS ${DATADIR}/xs_subset.tif)
set(IMAGEPAN ${DATADIR}/pan_subset.tif)
set(IMAGEPXS ${DATADIR}/pxs_subset.tif)
# Input models
set(MODEL1 ${MODELSDIR}/model1)
set(MODEL2 ${MODELSDIR}/model2)
set(MODEL3 ${MODELSDIR}/model3)
# Output images and baselines
set(MODEL1_PB_OUT apTvClTensorflowModelServeCNN16x16PB.tif)
set(MODEL2_PB_OUT apTvClTensorflowModelServeCNN8x8_32x32PB.tif)
set(MODEL2_FC_OUT apTvClTensorflowModelServeCNN8x8_32x32FC.tif)
set(MODEL3_PB_OUT apTvClTensorflowModelServeFCNN16x16PB.tif)
set(MODEL3_FC_OUT apTvClTensorflowModelServeFCNN16x16FC.tif)
#----------- Model serving : 1-branch CNN (16x16) Patch-Based ---------------- #----------- Model serving : 1-branch CNN (16x16) Patch-Based ----------------
set(ENV{OTB_TF_NSOURCES} 1) otb_test_application(NAME TensorflowModelServeCNN16x16PB
otb_test_application(NAME apTvClTensorflowModelServeCNN16x16
APP TensorflowModelServe APP TensorflowModelServe
OPTIONS -source1.il ${INPUTDATA}/${IMAGEXS} OPTIONS -source1.il ${IMAGEPXS}
-source1.rfiedx 16 -source1.rfieldy 16 -source1.placeholder x -source1.rfieldx 16 -source1.rfieldy 16 -source1.placeholder x
-model.dir ${TEMP}/${MODEL1} -output.names y -model.dir ${MODEL1} -output.names prediction
-out ${TEMP}/${MODEL1_PB_OUT} -out ${TEMP}/${MODEL1_PB_OUT}
VALID --compare-image ${EPSILON_6} VALID --compare-image ${EPSILON_6}
${INPUTDATA}/${MODEL1_PB_REF} ${DATADIR}/${MODEL1_PB_OUT}
${TEMP}/${MODEL1_PB_OUT}) ${TEMP}/${MODEL1_PB_OUT})
#----------- Model serving : 2-branch CNN (8x8, 32x32) Patch-Based ---------------- #----------- Model serving : 2-branch CNN (8x8, 32x32) Patch-Based ----------------
set(ENV{OTB_TF_NSOURCES} 2) otb_test_application(NAME apTvClTensorflowModelServeCNN8x8_32x32PB
otb_test_application(NAME apTvClTensorflowModelServeCNN8x8_32x32
APP TensorflowModelServe APP TensorflowModelServe
OPTIONS -source1.il ${INPUTDATA}/${IMAGEXS} OPTIONS -source1.il ${IMAGEXS}
-source1.rfiedx 8 -source1.rfieldy 8 -source1.placeholder x1 -source1.rfieldx 8 -source1.rfieldy 8 -source1.placeholder x1
-source2.il ${INPUTDATA}/${IMAGEPAN} -source2.il ${IMAGEPAN}
-source2.rfiedx 32 -source2.rfieldy 32 -source2.placeholder x2 -source2.rfieldx 32 -source2.rfieldy 32 -source2.placeholder x2
-model.dir ${TEMP}/${MODEL2} -output.names y -model.dir ${MODEL2} -output.names prediction
-out ${TEMP}/${MODEL2_PB_OUT} -out ${TEMP}/${MODEL2_PB_OUT}
VALID --compare-image ${EPSILON_6} VALID --compare-image ${EPSILON_6}
${INPUTDATA}/${MODEL2_PB_REF} ${DATADIR}/${MODEL2_PB_OUT}
${TEMP}/${MODEL2_PB_OUT}) ${TEMP}/${MODEL2_PB_OUT})
set_tests_properties(apTvClTensorflowModelServeCNN8x8_32x32PB PROPERTIES ENVIRONMENT "OTB_TF_NSOURCES=2;$ENV{OTB_TF_NSOURCES}")
#----------- Model serving : 2-branch CNN (8x8, 32x32) Fully-Conv ---------------- #----------- Model serving : 2-branch CNN (8x8, 32x32) Fully-Conv ----------------
set(ENV{OTB_TF_NSOURCES} 2) set(ENV{OTB_TF_NSOURCES} 2)
otb_test_application(NAME apTvClTensorflowModelServeCNN8x8_32x32 otb_test_application(NAME apTvClTensorflowModelServeCNN8x8_32x32FC
APP TensorflowModelServe APP TensorflowModelServe
OPTIONS -source1.il ${INPUTDATA}/${IMAGEXS} OPTIONS -source1.il ${IMAGEXS}
-source1.rfiedx 8 -source1.rfieldy 8 -source1.placeholder x1 -source1.rfieldx 8 -source1.rfieldy 8 -source1.placeholder x1
-source2.il ${INPUTDATA}/${IMAGEPAN} -source2.il ${IMAGEPAN}
-source2.rfiedx 32 -source2.rfieldy 32 -source2.placeholder x2 -source2.rfieldx 32 -source2.rfieldy 32 -source2.placeholder x2
-model.dir ${TEMP}/${MODEL2} -output.names y -output.spcscale 4 -model.dir ${MODEL2} -output.names prediction -output.spcscale 4
-out ${TEMP}/${MODEL2_FC_OUT} -out ${TEMP}/${MODEL2_FC_OUT}
VALID --compare-image ${EPSILON_6} VALID --compare-image ${EPSILON_6}
${INPUTDATA}/${MODEL2_FC_REF} ${DATADIR}/${MODEL2_FC_OUT}
${TEMP}/${MODEL2_FC_OUT}) ${TEMP}/${MODEL2_FC_OUT})
set_tests_properties(apTvClTensorflowModelServeCNN8x8_32x32FC PROPERTIES ENVIRONMENT "OTB_TF_NSOURCES=2;$ENV{OTB_TF_NSOURCES}")
#----------- Model serving : 1-branch FCNN (16x16) Patch-Based ---------------- #----------- Model serving : 1-branch FCNN (16x16) Patch-Based ----------------
set(ENV{OTB_TF_NSOURCES} 1) set(ENV{OTB_TF_NSOURCES} 1)
otb_test_application(NAME apTvClTensorflowModelServeFCNN16x16PB otb_test_application(NAME apTvClTensorflowModelServeFCNN16x16PB
APP TensorflowModelServe APP TensorflowModelServe
OPTIONS -source1.il ${INPUTDATA}/${IMAGEPXS} OPTIONS -source1.il ${IMAGEPXS}
-source1.rfiedx 16 -source1.rfieldy 16 -source1.placeholder x -source1.rfieldx 16 -source1.rfieldy 16 -source1.placeholder x
-model.dir ${TEMP}/${MODEL3} -output.names y -model.dir ${MODEL3} -output.names prediction
-out ${TEMP}/${MODEL3_PB_OUT} -out ${TEMP}/${MODEL3_PB_OUT}
VALID --compare-image ${EPSILON_6} VALID --compare-image ${EPSILON_6}
${INPUTDATA}/${MODEL3_PB_REF} ${DATADIR}/${MODEL3_PB_OUT}
${TEMP}/${MODEL3_PB_OUT}) ${TEMP}/${MODEL3_PB_OUT})
#----------- Model serving : 1-branch FCNN (16x16) Fully-conv ---------------- #----------- Model serving : 1-branch FCNN (16x16) Fully-conv ----------------
set(ENV{OTB_TF_NSOURCES} 1) set(ENV{OTB_TF_NSOURCES} 1)
otb_test_application(NAME apTvClTensorflowModelServeFCNN16x16FC otb_test_application(NAME apTvClTensorflowModelServeFCNN16x16FC
APP TensorflowModelServe APP TensorflowModelServe
OPTIONS -source1.il ${INPUTDATA}/${IMAGEXS} OPTIONS -source1.il ${IMAGEPXS}
-source1.rfiedx 16 -source1.rfieldy 16 -source1.placeholder x -source1.rfieldx 16 -source1.rfieldy 16 -source1.placeholder x
-model.dir ${TEMP}/${MODEL3} -output.names y -model.fullyconv on -model.dir ${MODEL3} -output.names prediction -model.fullyconv on
-out ${TEMP}/${MODEL3_FC_OUT} -out ${TEMP}/${MODEL3_FC_OUT}
VALID --compare-image ${EPSILON_6} VALID --compare-image ${EPSILON_6}
${INPUTDATA}/${MODEL3_FC_REF} ${DATADIR}/${MODEL3_FC_OUT}
${TEMP}/${MODEL3_FC_OUT}) ${TEMP}/${MODEL3_FC_OUT})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment