Une mise-à-jour de Gitlab vers la version 14.0 est prévue le 24 juin entre 14:00 et 15:00. Le service sera inaccessible ou instable pendant cette période. Merci de votre compréhension.

CMakeLists.txt 3.43 KB
Newer Older
Cresson Remi's avatar
Cresson Remi committed
1 2
otb_module_test()

3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# Directories
set(DATADIR ${CMAKE_CURRENT_SOURCE_DIR}/data)
set(MODELSDIR ${CMAKE_CURRENT_SOURCE_DIR}/models)

# Input images
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)
Cresson Remi's avatar
Cresson Remi committed
23 24

#----------- Model serving : 1-branch CNN (16x16) Patch-Based ----------------
25
otb_test_application(NAME TensorflowModelServeCNN16x16PB
Cresson Remi's avatar
Cresson Remi committed
26
  APP  TensorflowModelServe
27 28 29
  OPTIONS -source1.il ${IMAGEPXS}
  -source1.rfieldx 16 -source1.rfieldy 16 -source1.placeholder x
  -model.dir ${MODEL1} -output.names prediction
Cresson Remi's avatar
Cresson Remi committed
30
  -out ${TEMP}/${MODEL1_PB_OUT}
Cresson Remi's avatar
Cresson Remi committed
31
  VALID --compare-image ${EPSILON_6}
32
  ${DATADIR}/${MODEL1_PB_OUT}
Cresson Remi's avatar
Cresson Remi committed
33
  ${TEMP}/${MODEL1_PB_OUT})
Cresson Remi's avatar
Cresson Remi committed
34

Cresson Remi's avatar
Cresson Remi committed
35
#----------- Model serving : 2-branch CNN (8x8, 32x32) Patch-Based ----------------
36
otb_test_application(NAME apTvClTensorflowModelServeCNN8x8_32x32PB
Cresson Remi's avatar
Cresson Remi committed
37
  APP  TensorflowModelServe
38 39 40 41 42
  OPTIONS -source1.il ${IMAGEXS}
  -source1.rfieldx 8 -source1.rfieldy 8 -source1.placeholder x1
  -source2.il ${IMAGEPAN}
  -source2.rfieldx 32 -source2.rfieldy 32 -source2.placeholder x2
  -model.dir ${MODEL2} -output.names prediction
Cresson Remi's avatar
Cresson Remi committed
43 44
  -out ${TEMP}/${MODEL2_PB_OUT}
  VALID --compare-image ${EPSILON_6}
45
  ${DATADIR}/${MODEL2_PB_OUT}
Cresson Remi's avatar
Cresson Remi committed
46
  ${TEMP}/${MODEL2_PB_OUT})
47
set_tests_properties(apTvClTensorflowModelServeCNN8x8_32x32PB PROPERTIES ENVIRONMENT "OTB_TF_NSOURCES=2;$ENV{OTB_TF_NSOURCES}")
Cresson Remi's avatar
Cresson Remi committed
48 49 50

#----------- Model serving : 2-branch CNN (8x8, 32x32) Fully-Conv ----------------
set(ENV{OTB_TF_NSOURCES} 2)
51
otb_test_application(NAME apTvClTensorflowModelServeCNN8x8_32x32FC
Cresson Remi's avatar
Cresson Remi committed
52
  APP  TensorflowModelServe
53 54 55 56 57
  OPTIONS -source1.il ${IMAGEXS}
  -source1.rfieldx 8 -source1.rfieldy 8 -source1.placeholder x1
  -source2.il ${IMAGEPAN}
  -source2.rfieldx 32 -source2.rfieldy 32 -source2.placeholder x2
  -model.dir ${MODEL2} -output.names prediction -output.spcscale 4
Cresson Remi's avatar
Cresson Remi committed
58 59
  -out ${TEMP}/${MODEL2_FC_OUT}
  VALID --compare-image ${EPSILON_6}
60
  ${DATADIR}/${MODEL2_FC_OUT}
Cresson Remi's avatar
Cresson Remi committed
61
  ${TEMP}/${MODEL2_FC_OUT})
62
set_tests_properties(apTvClTensorflowModelServeCNN8x8_32x32FC PROPERTIES ENVIRONMENT "OTB_TF_NSOURCES=2;$ENV{OTB_TF_NSOURCES}")
Cresson Remi's avatar
Cresson Remi committed
63 64 65 66 67

#----------- Model serving : 1-branch FCNN (16x16) Patch-Based ----------------
set(ENV{OTB_TF_NSOURCES} 1)
otb_test_application(NAME apTvClTensorflowModelServeFCNN16x16PB
  APP  TensorflowModelServe
68 69 70
  OPTIONS -source1.il ${IMAGEPXS}
  -source1.rfieldx 16 -source1.rfieldy 16 -source1.placeholder x
  -model.dir ${MODEL3} -output.names prediction
Cresson Remi's avatar
Cresson Remi committed
71 72
  -out ${TEMP}/${MODEL3_PB_OUT}
  VALID --compare-image ${EPSILON_6}
73
  ${DATADIR}/${MODEL3_PB_OUT}
Cresson Remi's avatar
Cresson Remi committed
74 75 76 77 78 79
  ${TEMP}/${MODEL3_PB_OUT})

#----------- Model serving : 1-branch FCNN (16x16) Fully-conv ----------------
set(ENV{OTB_TF_NSOURCES} 1)
otb_test_application(NAME apTvClTensorflowModelServeFCNN16x16FC
  APP  TensorflowModelServe
80 81 82
  OPTIONS -source1.il ${IMAGEPXS}
  -source1.rfieldx 16 -source1.rfieldy 16 -source1.placeholder x
  -model.dir ${MODEL3} -output.names prediction -model.fullyconv on
Cresson Remi's avatar
Cresson Remi committed
83
  -out ${TEMP}/${MODEL3_FC_OUT}
Cresson Remi's avatar
Cresson Remi committed
84
  VALID --compare-image ${EPSILON_6}
85
  ${DATADIR}/${MODEL3_FC_OUT}
Cresson Remi's avatar
Cresson Remi committed
86
  ${TEMP}/${MODEL3_FC_OUT})
Cresson Remi's avatar
Cresson Remi committed
87 88