PageRenderTime 137ms CodeModel.GetById 31ms RepoModel.GetById 1ms app.codeStats 0ms

/cli/otap-word-spot/CMakeLists.txt

https://bitbucket.org/iesahin/otapexplorer
CMake | 1052 lines | 806 code | 210 blank | 36 comment | 17 complexity | ac4599170848ca2bc0cd2a6accdf8145 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. # This was depending to otap-database
  2. # include_directories(${PROJECT_SOURCE_DIR}/otap-database)
  3. set(OTAP_WORD_SPOT_VERSION_MAJOR 0)
  4. set(OTAP_WORD_SPOT_VERSION_MINOR 1)
  5. set(CC_FILES connected-component line-pair-feature single-line-feature shape-context-feature sift-feature surf-feature freak-feature orb-feature chamfer-feature component-area-feature projection-profile-feature feature comparator aggregate-comparator feature-factory curve-approximation otap-common)
  6. set(ALL_SERIAL_FEATURES contour-line-pair contour-single-line shape-context sift surf freak chamfer orb profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
  7. set(ALL_FEATURES aspect-ratio component-area ${ALL_SERIAL_FEATURES})
  8. option(TRACE_CHECK_POINTS "Convert CPx to Trace Points in the code" OFF)
  9. option(USE_ASPECT_RATIO "Use Aspect Ratio as a default feature" OFF)
  10. option(USE_LINE_PAIR "Use Line Pair as a default feature" OFF)
  11. option(USE_SINGLE_LINE "Use Single Line as a default feature" OFF)
  12. option(USE_SHAPE_CONTEXT "Use Shape Context as a default feauture" OFF)
  13. set(DO_CC_MATRIX_TESTS 1)
  14. set(DO_WS_MATRIX_TESTS 0)
  15. set(DO_OTAP_WS_OTM20_TEST 0)
  16. set(DO_OTAP_WS_OTM5_TEST 0)
  17. set(DO_OTAP_WS_GW20_TEST 0)
  18. set(DO_IMAGE_RETRIEVAL_GW20_TESTS 0)
  19. set(DO_IMAGE_RETRIEVAL_LM_TESTS 0)
  20. set(DO_RECALL_PRECISION_LM_TESTS 0)
  21. set(DO_RECALL_PRECISION_LMSMALL_TESTS 0)
  22. set(DO_RECALL_PRECISION_GW77_TESTS 0)
  23. set(DO_RECALL_PRECISION_GW16_TESTS 1)
  24. set(DO_RECALL_PRECISION_IFNC5I300_TESTS 0)
  25. set(DO_RECALL_PRECISION_IFNC44I1000_TESTS 0)
  26. set(DO_RECALL_PRECISION_DEBUG_TESTS 0)
  27. configure_file(cmake-options.hpp.in ${PROJECT_SOURCE_DIR}/otap-word-spot/cmake-options.hpp)
  28. ## global tags for all dependencies etc
  29. # set_source_files_properties( GTAGS PROPERTIES GENERATED true)
  30. # add_custom_command ( OUTPUT GTAGS
  31. # COMMAND gtags
  32. # WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../ )
  33. # TEST TARGETS
  34. add_executable(abc abc.cpp)
  35. add_executable(cppdeneme cppdeneme)
  36. add_executable(otap-common-test otap-common-test otap-common)
  37. add_executable(feature-test
  38. feature-test
  39. feature
  40. otap-common
  41. test-common-defs)
  42. add_executable(comparator-test
  43. comparator-test
  44. comparator
  45. feature
  46. curve-approximation
  47. otap-common
  48. test-common-defs)
  49. add_executable(aggregate-comparator-test
  50. aggregate-comparator-test
  51. aggregate-comparator
  52. comparator
  53. feature
  54. curve-approximation
  55. otap-common
  56. test-common-defs)
  57. add_executable(line-pair-feature-test
  58. line-pair-feature-test
  59. line-pair-feature
  60. feature
  61. comparator
  62. otap-common
  63. test-common-defs)
  64. add_executable(single-line-feature-test
  65. single-line-feature-test
  66. single-line-feature
  67. feature
  68. comparator
  69. otap-common
  70. test-common-defs)
  71. add_executable(shape-context-feature-test
  72. shape-context-feature-test
  73. shape-context-feature
  74. feature
  75. comparator
  76. otap-common
  77. test-common-defs)
  78. add_executable(sift-feature-test
  79. sift-feature-test
  80. ${CC_FILES}
  81. test-common-defs)
  82. add_executable(surf-feature-test
  83. surf-feature-test
  84. ${CC_FILES}
  85. test-common-defs)
  86. add_executable(freak-feature-test
  87. freak-feature-test
  88. ${CC_FILES}
  89. test-common-defs)
  90. add_executable(chamfer-feature-test
  91. chamfer-feature-test
  92. chamfer-feature
  93. surf-feature
  94. sift-feature
  95. freak-feature
  96. feature
  97. comparator
  98. connected-component
  99. otap-common
  100. test-common-defs)
  101. add_executable(component-area-feature-test
  102. component-area-feature-test
  103. component-area-feature
  104. surf-feature
  105. sift-feature
  106. freak-feature
  107. feature
  108. comparator
  109. connected-component
  110. otap-common
  111. test-common-defs)
  112. add_executable(projection-profile-feature-test
  113. projection-profile-feature-test
  114. ${CC_FILES}
  115. test-common-defs)
  116. add_executable(connected-component-test
  117. connected-component-test
  118. test-common-defs
  119. ${CC_FILES})
  120. add_executable(component-filter-test
  121. component-filter-test
  122. component-filter
  123. test-common-defs
  124. ${CC_FILES})
  125. add_executable(page-image-test
  126. page-image-test
  127. page-image
  128. test-common-defs
  129. ${CC_FILES})
  130. add_executable(curve-approximation-test
  131. curve-approximation-test
  132. curve-approximation
  133. page-image
  134. test-common-defs
  135. ${CC_FILES})
  136. add_executable(word-spot-test
  137. word-spot-test
  138. word-spot
  139. page-image
  140. test-common-defs
  141. ${CC_FILES})
  142. add_executable(word-spot-page-query-test
  143. word-spot-page-query-test
  144. word-spot-page-query
  145. word-spot
  146. page-image
  147. ${CC_FILES}
  148. test-common-defs)
  149. add_executable(word-spot-query-test
  150. word-spot-query-test
  151. word-spot-query
  152. word-spot-page-query
  153. word-spot-page-query
  154. word-spot
  155. page-image
  156. test-common-defs
  157. ${CC_FILES})
  158. add_executable(word-spot-query-manager-test
  159. word-spot-query-manager-test
  160. word-spot-query-manager
  161. word-spot-query
  162. word-spot-page-query
  163. word-spot
  164. page-image
  165. ${CC_FILES}
  166. test-common-defs)
  167. # MAIN TARGETS
  168. add_executable(similar-files
  169. similar-files
  170. page-image
  171. ${CC_FILES})
  172. add_executable(cc-matrix
  173. cc-matrix
  174. curve-approximation
  175. page-image
  176. ${CC_FILES})
  177. add_executable(ws-matrix
  178. ws-matrix
  179. word-spot-query
  180. word-spot-page-query
  181. word-spot
  182. page-image
  183. ${CC_FILES})
  184. add_executable(image-retrieval
  185. image-retrieval
  186. word-spot
  187. page-image
  188. ${CC_FILES})
  189. add_executable(retrieval-recall-precision
  190. retrieval-recall-precision
  191. word-spot
  192. page-image
  193. ${CC_FILES})
  194. add_executable(shard-page-components
  195. shard-page-components
  196. page-image
  197. ${CC_FILES})
  198. add_executable(otap-word-spot
  199. main
  200. word-spot-query-manager
  201. word-spot-query
  202. word-spot-page-query
  203. word-spot
  204. page-image
  205. ${CC_FILES})
  206. # LINK DEFINITIONS
  207. target_link_libraries(abc opencv_core opencv_highgui opencv_imgproc boost_program_options)
  208. target_link_libraries(cppdeneme ${OTAP_TESTING_LIBS})
  209. target_link_libraries(otap-common-test ${OTAP_TESTING_LIBS})
  210. target_link_libraries(feature-test ${OTAP_TESTING_LIBS})
  211. target_link_libraries(comparator-test ${OTAP_TESTING_LIBS})
  212. target_link_libraries(aggregate-comparator-test ${OTAP_TESTING_LIBS})
  213. target_link_libraries(line-pair-feature-test ${OTAP_TESTING_LIBS})
  214. target_link_libraries(single-line-feature-test ${OTAP_TESTING_LIBS})
  215. target_link_libraries(shape-context-feature-test ${OTAP_TESTING_LIBS})
  216. target_link_libraries(sift-feature-test ${OTAP_TESTING_LIBS})
  217. target_link_libraries(surf-feature-test ${OTAP_TESTING_LIBS})
  218. target_link_libraries(chamfer-feature-test ${OTAP_TESTING_LIBS})
  219. target_link_libraries(component-area-feature-test ${OTAP_TESTING_LIBS})
  220. target_link_libraries(freak-feature-test ${OTAP_TESTING_LIBS})
  221. target_link_libraries(projection-profile-feature-test ${OTAP_TESTING_LIBS})
  222. target_link_libraries(connected-component-test ${OTAP_TESTING_LIBS})
  223. target_link_libraries(component-filter-test ${OTAP_TESTING_LIBS})
  224. target_link_libraries(page-image-test ${OTAP_TESTING_LIBS})
  225. target_link_libraries(curve-approximation-test ${OTAP_TESTING_LIBS})
  226. target_link_libraries(word-spot-test ${OTAP_TESTING_LIBS})
  227. target_link_libraries(word-spot-page-query-test ${OTAP_TESTING_LIBS})
  228. target_link_libraries(word-spot-query-test ${OTAP_TESTING_LIBS})
  229. target_link_libraries(word-spot-query-manager-test ${OTAP_TESTING_LIBS})
  230. target_link_libraries(otap-word-spot ${OTAP_COMMON_LIBS})
  231. target_link_libraries(cc-matrix ${OTAP_TESTING_LIBS})
  232. target_link_libraries(ws-matrix ${OTAP_TESTING_LIBS})
  233. target_link_libraries(image-retrieval ${OTAP_TESTING_LIBS})
  234. target_link_libraries(retrieval-recall-precision ${OTAP_TESTING_LIBS})
  235. target_link_libraries(shard-page-components ${OTAP_COMMON_LIBS})
  236. target_link_libraries(similar-files ${OTAP_COMMON_LIBS})
  237. # add_custom_command(TARGET abc
  238. # POST_BUILD
  239. # COMMAND abc ../test-image.png)
  240. add_custom_command(TARGET cppdeneme
  241. POST_BUILD
  242. COMMAND cppdeneme)
  243. add_custom_command(TARGET otap-common-test
  244. POST_BUILD
  245. COMMAND otap-common-test)
  246. add_custom_command(TARGET feature-test
  247. POST_BUILD
  248. COMMAND feature-test)
  249. add_custom_command(TARGET comparator-test
  250. POST_BUILD
  251. COMMAND comparator-test)
  252. add_custom_command(TARGET aggregate-comparator-test
  253. POST_BUILD
  254. COMMAND aggregate-comparator-test)
  255. add_custom_command(TARGET line-pair-feature-test
  256. POST_BUILD
  257. COMMAND line-pair-feature-test)
  258. add_custom_command(TARGET single-line-feature-test
  259. POST_BUILD
  260. COMMAND single-line-feature-test)
  261. add_custom_command(TARGET shape-context-feature-test
  262. POST_BUILD
  263. COMMAND shape-context-feature-test)
  264. add_custom_command(TARGET sift-feature-test
  265. POST_BUILD
  266. COMMAND sift-feature-test)
  267. add_custom_command(TARGET surf-feature-test
  268. POST_BUILD
  269. COMMAND surf-feature-test)
  270. add_custom_command(TARGET chamfer-feature-test
  271. POST_BUILD
  272. COMMAND chamfer-feature-test)
  273. add_custom_command(TARGET component-area-feature-test
  274. POST_BUILD
  275. COMMAND component-area-feature-test)
  276. add_custom_command(TARGET projection-profile-feature-test
  277. POST_BUILD
  278. COMMAND projection-profile-feature-test)
  279. add_custom_command(TARGET freak-feature-test
  280. POST_BUILD
  281. COMMAND freak-feature-test)
  282. add_custom_command(TARGET connected-component-test
  283. POST_BUILD
  284. COMMAND connected-component-test)
  285. add_custom_command(TARGET component-filter-test
  286. POST_BUILD
  287. COMMAND component-filter-test)
  288. add_custom_command(TARGET page-image-test
  289. POST_BUILD
  290. COMMAND page-image-test)
  291. add_custom_command(TARGET curve-approximation-test
  292. POST_BUILD
  293. COMMAND curve-approximation-test)
  294. add_custom_command(TARGET word-spot-test
  295. POST_BUILD
  296. COMMAND word-spot-test)
  297. add_custom_command(TARGET word-spot-page-query-test
  298. POST_BUILD
  299. COMMAND word-spot-page-query-test)
  300. add_custom_command(TARGET word-spot-query-test
  301. POST_BUILD
  302. COMMAND word-spot-query-test)
  303. add_custom_command(TARGET word-spot-query-manager-test
  304. POST_BUILD
  305. COMMAND word-spot-query-manager-test)
  306. # add_custom_command(TARGET cc-matrix
  307. # POST_BUILD
  308. # COMMAND valgrind --tool=memcheck --leak-check=yes ./cc-matrix --result-size 100 --input ../../../experiments/two/2.png --output-file cc-matrix-result.yml)
  309. if(${DO_OTAP_WS_OTM20_TEST})
  310. set (OTAP_WS_PAGE_DIR ${PROJECT_SOURCE_DIR}/../web/static/wordspot/pages20/)
  311. file(GLOB OTAP_WS_QUERY_FILES ${PROJECT_SOURCE_DIR}/../experiments/otap-word-spot/otm20/queries/*.png)
  312. foreach(ff ${OTAP_WS_QUERY_FILES})
  313. message (${ff})
  314. endforeach(ff)
  315. set (OTAP_WS_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/../experiments/otap-word-spot/otm20/results/)
  316. # set (OTAP_WS_FEATURES contour-line-pair contour-single-line shape-context)
  317. set (OTAP_WS_FEATURES shape-context)
  318. # set (OTAP_WS_SERIAL_COMPARATORS minimums in-order spanning-minimums)
  319. set (OTAP_WS_SERIAL_COMPARATORS minimums minimums in-order spanning-minimums)
  320. set (OTAP_WS_SCALAR_COMPARATORS plain)
  321. foreach(query_file ${OTAP_WS_QUERY_FILES})
  322. string(RANDOM outdir_name)
  323. add_custom_command(TARGET otap-word-spot
  324. POST_BUILD
  325. COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name})
  326. add_custom_command(TARGET otap-word-spot
  327. POST_BUILD
  328. COMMAND ${PROJECT_SOURCE_DIR}/../scripts/2colorthresh ${query_file} ${OTAP_WS_OUTPUT_DIR}${outdir_name}/query.png)
  329. foreach(feature ${OTAP_WS_FEATURES})
  330. foreach(serial_cmp ${OTAP_WS_SERIAL_COMPARATORS})
  331. foreach(scalar_cmp ${OTAP_WS_SCALAR_COMPARATORS})
  332. add_custom_command(TARGET otap-word-spot
  333. POST_BUILD
  334. COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
  335. add_custom_command(TARGET otap-word-spot
  336. POST_BUILD
  337. COMMAND otap-word-spot --result-size 20 --image-dir ${OTAP_WS_PAGE_DIR} --query-dir ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/query.png --output-filename ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --span-size 5)
  338. endforeach(scalar_cmp)
  339. endforeach(serial_cmp)
  340. endforeach(feature)
  341. endforeach(query_file)
  342. endif()
  343. if(${DO_OTAP_WS_OTM5_TEST})
  344. set (OTAP_WS_PAGE_DIR ${PROJECT_SOURCE_DIR}/../web/static/wordspot/pages/)
  345. file(GLOB OTAP_WS_QUERY_FILES ${PROJECT_SOURCE_DIR}/../experiments/otap-word-spot/otm5/queries/*.png)
  346. foreach(ff ${OTAP_WS_QUERY_FILES})
  347. message (${ff})
  348. endforeach(ff)
  349. set (OTAP_WS_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/../experiments/otap-word-spot/otm5/results/)
  350. # set (OTAP_WS_FEATURES contour-line-pair contour-single-line shape-context)
  351. set (OTAP_WS_FEATURES contour-single-line shape-context)
  352. # set (OTAP_WS_SERIAL_COMPARATORS minimums in-order spanning-minimums)
  353. set (OTAP_WS_SERIAL_COMPARATORS minimums)
  354. set (OTAP_WS_SCALAR_COMPARATORS plain)
  355. foreach(query_file ${OTAP_WS_QUERY_FILES})
  356. string(RANDOM outdir_name)
  357. add_custom_command(TARGET otap-word-spot
  358. POST_BUILD
  359. COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name})
  360. add_custom_command(TARGET otap-word-spot
  361. POST_BUILD
  362. COMMAND ${PROJECT_SOURCE_DIR}/../scripts/2colorthresh ${query_file} ${OTAP_WS_OUTPUT_DIR}${outdir_name}/query.png)
  363. foreach(feature ${OTAP_WS_FEATURES})
  364. foreach(serial_cmp ${OTAP_WS_SERIAL_COMPARATORS})
  365. foreach(scalar_cmp ${OTAP_WS_SCALAR_COMPARATORS})
  366. add_custom_command(TARGET otap-word-spot
  367. POST_BUILD
  368. COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
  369. add_custom_command(TARGET otap-word-spot
  370. POST_BUILD
  371. COMMAND otap-word-spot --result-size 20 --image-dir ${OTAP_WS_PAGE_DIR} --query-dir ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/query.png --output-filename ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp})
  372. endforeach(scalar_cmp)
  373. endforeach(serial_cmp)
  374. endforeach(feature)
  375. endforeach(query_file)
  376. endif()
  377. if(${DO_OTAP_WS_GW20_TEST})
  378. set (OTAP_WS_PAGE_DIR ../../../experiments/iam-gw/gw/data/line_images_normalized/)
  379. file(GLOB OTAP_WS_QUERY_FILES ../../experiments/iam-gw/gw/queries/*.png)
  380. foreach(ff ${OTAP_WS_QUERY_FILES})
  381. message (${ff})
  382. endforeach(ff)
  383. set (OTAP_WS_OUTPUT_DIR ../../../experiments/iam-gw/gw/results/)
  384. # set (OTAP_WS_FEATURES contour-line-pair contour-single-line shape-context)
  385. set (OTAP_WS_FEATURES shape-context)
  386. # set (OTAP_WS_SERIAL_COMPARATORS minimums in-order spanning-minimums)
  387. set (OTAP_WS_SERIAL_COMPARATORS minimums)
  388. set (OTAP_WS_SCALAR_COMPARATORS plain)
  389. foreach(query_file ${OTAP_WS_QUERY_FILES})
  390. string(RANDOM outdir_name)
  391. add_custom_command(TARGET otap-word-spot
  392. POST_BUILD
  393. COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name} && cp ${query_file} ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/query.png)
  394. foreach(feature ${OTAP_WS_FEATURES})
  395. foreach(serial_cmp ${OTAP_WS_SERIAL_COMPARATORS})
  396. foreach(scalar_cmp ${OTAP_WS_SCALAR_COMPARATORS})
  397. add_custom_command(TARGET otap-word-spot
  398. POST_BUILD
  399. COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
  400. add_custom_command(TARGET otap-word-spot
  401. POST_BUILD
  402. COMMAND otap-word-spot --result-size 20 --image-dir ${OTAP_WS_PAGE_DIR} --query-dir ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/query.png --output-filename ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/output.log)
  403. endforeach(scalar_cmp)
  404. endforeach(serial_cmp)
  405. endforeach(feature)
  406. endforeach(query_file)
  407. endif()
  408. if(${DO_CC_MATRIX_TESTS})
  409. set (CC_MATRIX_PAGE_IMAGE ../../../experiments/three/page.png)
  410. set (CC_MATRIX_QUERY_IMAGE ../../../experiments/three/query.png)
  411. set (CC_MATRIX_OUTPUT_DIR ../../../experiments/three/)
  412. set (CC_MATRIX_FEATURES ${ALL_FEATURES})
  413. set (CC_MATRIX_RICH_FEATURES sift freak surf)
  414. # set (CC_MATRIX_SERIAL_COMPARATORS minimums maximums in-order spanning-minimums spanning-maximums)
  415. set (CC_MATRIX_SERIAL_COMPARATORS minimums dynamic-minimums)
  416. # set (CC_MATRIX_SCALAR_COMPARATORS plain sigmoid sigmoid-square)
  417. set (CC_MATRIX_SCALAR_COMPARATORS plain)
  418. foreach(feature ${CC_MATRIX_RICH_FEATURES})
  419. foreach(serial_cmp ${CC_MATRIX_SERIAL_COMPARATORS})
  420. foreach(scalar_cmp ${CC_MATRIX_SCALAR_COMPARATORS})
  421. foreach(desc_size 1 2 4 9)
  422. add_custom_command(TARGET cc-matrix
  423. POST_BUILD
  424. COMMAND echo Processing: ${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}-)
  425. add_custom_command(TARGET cc-matrix
  426. POST_BUILD
  427. COMMAND mkdir -p ${CC_MATRIX_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp})
  428. add_custom_command(TARGET cc-matrix
  429. POST_BUILD
  430. COMMAND cc-matrix --result-size 100 --input ${CC_MATRIX_PAGE_IMAGE} --output-file ${CC_MATRIX_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}.html --descriptor-size ${desc_size} --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${CC_MATRIX_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}.log)
  431. endforeach(desc_size)
  432. endforeach(scalar_cmp)
  433. endforeach(serial_cmp)
  434. endforeach(feature)
  435. foreach(feature ${CC_MATRIX_FEATURES})
  436. foreach(serial_cmp ${CC_MATRIX_SERIAL_COMPARATORS})
  437. foreach(scalar_cmp ${CC_MATRIX_SCALAR_COMPARATORS})
  438. add_custom_command(TARGET cc-matrix
  439. POST_BUILD
  440. COMMAND echo Processing: ${feature}-${serial_cmp}-${scalar_cmp})
  441. add_custom_command(TARGET cc-matrix
  442. POST_BUILD
  443. COMMAND mkdir -p ${CC_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp})
  444. add_custom_command(TARGET cc-matrix
  445. POST_BUILD
  446. COMMAND cc-matrix --result-size 100 --input ${CC_MATRIX_PAGE_IMAGE} --output-file ${CC_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp}/${feature}-${serial_cmp}-${scalar_cmp}.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${CC_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp}/${feature}-${serial_cmp}-${scalar_cmp}.log)
  447. endforeach(scalar_cmp)
  448. endforeach(serial_cmp)
  449. endforeach(feature)
  450. endif()
  451. if(${DO_IMAGE_RETRIEVAL_GW20_TESTS})
  452. set (GW20_WORDS ../../../experiments/iam-gw/gw/data/word_images_normalized/)
  453. file(GLOB IMAGE_RETRIEVAL_QUERY_FILES ../../experiments/iam-gw/image-retrieval/queries/*.png)
  454. foreach(ff ${IMAGE_RETRIEVAL_QUERY_FILES})
  455. message (${ff})
  456. endforeach(ff)
  457. set (IMAGE_RETRIEVAL_OUTPUT_DIR ../../../experiments/iam-gw/image-retrieval/results/)
  458. # set (IMAGE_RETRIEVAL_FEATURES contour-line-pair contour-single-line shape-context)
  459. set (IMAGE_RETRIEVAL_FEATURES chamfer freak sift surf contour-line-pair contour-single-line shape-context)
  460. # set (IMAGE_RETRIEVAL_SERIAL_COMPARATORS minimums in-order spanning-minimums)
  461. set (IMAGE_RETRIEVAL_SERIAL_COMPARATORS dynamic-minimums)
  462. set (IMAGE_RETRIEVAL_SCALAR_COMPARATORS euclidean)
  463. foreach(query_file ${IMAGE_RETRIEVAL_QUERY_FILES})
  464. string(RANDOM outdir_name)
  465. add_custom_command(TARGET image-retrieval
  466. POST_BUILD
  467. COMMAND mkdir -p ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name} && cp ${query_file} ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/)
  468. foreach(feature ${IMAGE_RETRIEVAL_FEATURES})
  469. foreach(serial_cmp ${IMAGE_RETRIEVAL_SERIAL_COMPARATORS})
  470. foreach(scalar_cmp ${IMAGE_RETRIEVAL_SCALAR_COMPARATORS})
  471. add_custom_command(TARGET image-retrieval
  472. POST_BUILD
  473. COMMAND echo Processing: ${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
  474. add_custom_command(TARGET image-retrieval
  475. POST_BUILD
  476. COMMAND mkdir -p ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
  477. add_custom_command(TARGET image-retrieval
  478. POST_BUILD
  479. COMMAND image-retrieval --result-size 20 --input ${GW20_WORDS} --query-image ${query_file} --output-file ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/output.log)
  480. endforeach(scalar_cmp)
  481. endforeach(serial_cmp)
  482. endforeach(feature)
  483. endforeach(query_file)
  484. endif()
  485. if(${DO_IMAGE_RETRIEVAL_LM_TESTS})
  486. set (LM_WORDS ../../../experiments/leylamecnun/words/)
  487. file(GLOB IMAGE_RETRIEVAL_QUERY_FILES ../../experiments/leylamecnun/queries/*.png)
  488. foreach(ff ${IMAGE_RETRIEVAL_QUERY_FILES})
  489. message (${ff})
  490. endforeach(ff)
  491. set (IMAGE_RETRIEVAL_OUTPUT_DIR ../../../experiments/leylamecnun/results/)
  492. # set (IMAGE_RETRIEVAL_FEATURES contour-line-pair contour-single-line shape-context)
  493. set (IMAGE_RETRIEVAL_FEATURES component-area chamfer freak sift surf contour-line-pair contour-single-line shape-context)
  494. # set (IMAGE_RETRIEVAL_SERIAL_COMPARATORS minimums in-order spanning-minimums)
  495. set (IMAGE_RETRIEVAL_SERIAL_COMPARATORS dynamic-minimums)
  496. set (IMAGE_RETRIEVAL_SCALAR_COMPARATORS euclidean)
  497. foreach(query_file ${IMAGE_RETRIEVAL_QUERY_FILES})
  498. string(RANDOM outdir_name)
  499. add_custom_command(TARGET image-retrieval
  500. POST_BUILD
  501. COMMAND mkdir -p ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name} && cp ${query_file} ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/)
  502. foreach(feature ${IMAGE_RETRIEVAL_FEATURES})
  503. foreach(serial_cmp ${IMAGE_RETRIEVAL_SERIAL_COMPARATORS})
  504. foreach(scalar_cmp ${IMAGE_RETRIEVAL_SCALAR_COMPARATORS})
  505. add_custom_command(TARGET image-retrieval
  506. POST_BUILD
  507. COMMAND echo Processing: ${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
  508. add_custom_command(TARGET image-retrieval
  509. POST_BUILD
  510. COMMAND mkdir -p ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
  511. add_custom_command(TARGET image-retrieval
  512. POST_BUILD
  513. COMMAND image-retrieval --result-size 20 --input ${LM_WORDS} --query-image ${query_file} --output-file ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/output.log)
  514. endforeach(scalar_cmp)
  515. endforeach(serial_cmp)
  516. endforeach(feature)
  517. endforeach(query_file)
  518. endif()
  519. if(${DO_WS_MATRIX_TESTS})
  520. set (WS_MATRIX_PAGE_IMAGE ../../../experiments/ws/three/page.png)
  521. set (WS_MATRIX_QUERY_IMAGE ../../../experiments/ws/three/query.png)
  522. set (WS_MATRIX_OUTPUT_DIR ../../../experiments/ws/three/)
  523. set (WS_MATRIX_FEATURES aspect-ratio contour-line-pair contour-single-line shape-context)
  524. # set (WS_MATRIX_SERIAL_COMPARATORS minimums maximums in-order spanning-minimums spanning-maximums)
  525. set (WS_MATRIX_SERIAL_COMPARATORS minimums)
  526. # set (WS_MATRIX_SCALAR_COMPARATORS plain sigmoid sigmoid-square)
  527. set (WS_MATRIX_SCALAR_COMPARATORS plain)
  528. foreach(feature ${WS_MATRIX_FEATURES})
  529. foreach(serial_cmp ${WS_MATRIX_SERIAL_COMPARATORS})
  530. foreach(scalar_cmp ${WS_MATRIX_SCALAR_COMPARATORS})
  531. add_custom_command(TARGET ws-matrix
  532. POST_BUILD
  533. COMMAND mkdir -p ${WS_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp})
  534. add_custom_command(TARGET ws-matrix
  535. POST_BUILD
  536. COMMAND ws-matrix --result-size 100 --page-image ${WS_MATRIX_PAGE_IMAGE} --query-image ${WS_MATRIX_QUERY_IMAGE} --output-file ${WS_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp}/${feature}-${serial_cmp}-${scalar_cmp}.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp})
  537. endforeach(scalar_cmp)
  538. endforeach(serial_cmp)
  539. endforeach(feature)
  540. endif()
  541. if(${DO_RECALL_PRECISION_LMSMALL_TESTS})
  542. set (RP_INPUT_DIR ../../../experiments/rp/leylamecnun-small/)
  543. set (RP_OUTPUT_DIR ../../../experiments/rp/results/leylamecnun-small/)
  544. # set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
  545. set (RP_FEATURES contour-line-pair contour-single-line shape-context)
  546. set (RP_SERIAL_COMPARATORS dynamic-minimums minimums matching-minimums)
  547. set (RP_SCALAR_COMPARATORS plain )
  548. add_custom_command(TARGET retrieval-recall-precision
  549. POST_BUILD
  550. COMMAND mkdir -p ${RP_OUTPUT_DIR})
  551. foreach(feature ${RP_FEATURES})
  552. foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
  553. foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
  554. foreach(desc_size 4)
  555. foreach(subst_cost_func const)
  556. foreach(subst_cost_mod 1)
  557. foreach(delete_cost_func pow)
  558. foreach(delete_cost_mod 2)
  559. foreach(location_weight 0.0 0.8 1.6 3.2 6.4 12.8)
  560. string(RANDOM outfile_suffix)
  561. set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-feat-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
  562. add_custom_command(TARGET retrieval-recall-precision
  563. POST_BUILD
  564. COMMAND echo Processing: ${output_file})
  565. add_custom_command(TARGET retrieval-recall-precision
  566. POST_BUILD
  567. COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-feature-weight 0.8 --wordspot-location-weight ${location_weight} --wordspot-use-feature-pool > ${output_file}.log
  568. )
  569. add_custom_command(TARGET retrieval-recall-precision
  570. POST_BUILD
  571. COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
  572. add_custom_command(TARGET retrieval-recall-precision
  573. POST_BUILD
  574. COMMAND rm ${output_file}.log)
  575. add_custom_command(TARGET retrieval-recall-precision
  576. POST_BUILD
  577. COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
  578. endforeach(location_weight)
  579. endforeach(delete_cost_mod)
  580. endforeach(delete_cost_func)
  581. endforeach(subst_cost_mod)
  582. endforeach(subst_cost_func)
  583. endforeach(desc_size)
  584. endforeach(scalar_cmp)
  585. endforeach(serial_cmp)
  586. endforeach(feature)
  587. endif()
  588. if(${DO_RECALL_PRECISION_LM_TESTS})
  589. set (RP_INPUT_DIR ../../../experiments/rp/leylamecnun/)
  590. set (RP_OUTPUT_DIR ../../../experiments/rp/results/leylamecnun/)
  591. # set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
  592. set (RP_FEATURES contour-line-pair contour-single-line shape-context sift surf freak chamfer profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
  593. set (RP_SERIAL_COMPARATORS dynamic-minimums)
  594. set (RP_SCALAR_COMPARATORS euclidean )
  595. set (RP_COST_MODIFIERS 2)
  596. add_custom_command(TARGET retrieval-recall-precision
  597. POST_BUILD
  598. COMMAND mkdir -p ${RP_OUTPUT_DIR})
  599. foreach(feature ${RP_FEATURES})
  600. foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
  601. foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
  602. foreach(desc_size 4)
  603. foreach(subst_cost_func const)
  604. foreach(subst_cost_mod ${RP_COST_MODIFIERS})
  605. foreach(delete_cost_func pow)
  606. foreach(delete_cost_mod ${RP_COST_MODIFIERS})
  607. foreach(location_weight 3.2)
  608. string(RANDOM outfile_suffix)
  609. set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
  610. add_custom_command(TARGET retrieval-recall-precision
  611. POST_BUILD
  612. COMMAND echo Processing: ${output_file})
  613. add_custom_command(TARGET retrieval-recall-precision
  614. POST_BUILD
  615. COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-feature-weight 0.8 --wordspot-location-weight ${location_weight} --wordspot-use-feature-pool > ${output_file}.log
  616. )
  617. add_custom_command(TARGET retrieval-recall-precision
  618. POST_BUILD
  619. COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
  620. add_custom_command(TARGET retrieval-recall-precision
  621. POST_BUILD
  622. COMMAND rm ${output_file}.log)
  623. add_custom_command(TARGET retrieval-recall-precision
  624. POST_BUILD
  625. COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
  626. endforeach(location_weight)
  627. endforeach(delete_cost_mod)
  628. endforeach(delete_cost_func)
  629. endforeach(subst_cost_mod)
  630. endforeach(subst_cost_func)
  631. endforeach(desc_size)
  632. endforeach(scalar_cmp)
  633. endforeach(serial_cmp)
  634. endforeach(feature)
  635. endif()
  636. if(${DO_RECALL_PRECISION_GW16_TESTS})
  637. set (RP_INPUT_DIR ../../../experiments/rp/iam-gw-small/)
  638. set (RP_OUTPUT_DIR ../../../experiments/rp/results/iam-gw-small-new-dynamic-mins/)
  639. # set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
  640. set (RP_FEATURES ${ALL_SERIAL_FEATURES})
  641. set (RP_SERIAL_COMPARATORS dynamic-time-warping)
  642. set (RP_SCALAR_COMPARATORS plain)
  643. add_custom_command(TARGET retrieval-recall-precision
  644. POST_BUILD
  645. COMMAND mkdir -p ${RP_OUTPUT_DIR})
  646. foreach(feature ${RP_FEATURES})
  647. foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
  648. foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
  649. foreach(desc_size 4)
  650. foreach(subst_cost_func const)
  651. foreach(subst_cost_mod 1)
  652. foreach(delete_cost_func pow)
  653. foreach(delete_cost_mod 2)
  654. foreach(location_weight 0.0)
  655. string(RANDOM outfile_suffix)
  656. set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
  657. add_custom_command(TARGET retrieval-recall-precision
  658. POST_BUILD
  659. COMMAND echo Processing: ${output_file})
  660. add_custom_command(TARGET retrieval-recall-precision
  661. POST_BUILD
  662. COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-use-feature-pool > ${output_file}.log
  663. )
  664. add_custom_command(TARGET retrieval-recall-precision
  665. POST_BUILD
  666. COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
  667. add_custom_command(TARGET retrieval-recall-precision
  668. POST_BUILD
  669. COMMAND rm ${output_file}.log)
  670. add_custom_command(TARGET retrieval-recall-precision
  671. POST_BUILD
  672. COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
  673. endforeach(location_weight)
  674. endforeach(delete_cost_mod)
  675. endforeach(delete_cost_func)
  676. endforeach(subst_cost_mod)
  677. endforeach(subst_cost_func)
  678. endforeach(desc_size)
  679. endforeach(scalar_cmp)
  680. endforeach(serial_cmp)
  681. endforeach(feature)
  682. endif()
  683. if(${DO_RECALL_PRECISION_GW77_TESTS})
  684. set (RP_INPUT_DIR ../../../experiments/rp/iam-gw/)
  685. set (RP_OUTPUT_DIR ../../../experiments/rp/results/iam-gw/)
  686. set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
  687. set (RP_FEATURES profile-projection chamfer contour-line-pair sift)
  688. set (RP_SERIAL_COMPARATORS dynamic-minimums)
  689. set (RP_SCALAR_COMPARATORS euclidean )
  690. add_custom_command(TARGET retrieval-recall-precision
  691. POST_BUILD
  692. COMMAND mkdir -p ${RP_OUTPUT_DIR})
  693. foreach(feature ${RP_FEATURES})
  694. foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
  695. foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
  696. foreach(desc_size 4)
  697. foreach(subst_cost_func const)
  698. foreach(subst_cost_mod 1)
  699. foreach(delete_cost_func pow)
  700. foreach(delete_cost_mod 4)
  701. foreach(location_weight 0)
  702. string(RANDOM outfile_suffix)
  703. set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-${outfile_suffix}.csv)
  704. add_custom_command(TARGET retrieval-recall-precision
  705. POST_BUILD
  706. COMMAND echo Processing: ${output_file})
  707. add_custom_command(TARGET retrieval-recall-precision
  708. POST_BUILD
  709. COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-location-weight ${location_weight} > ${output_file}.log
  710. )
  711. add_custom_command(TARGET retrieval-recall-precision
  712. POST_BUILD
  713. COMMAND rm ${output_file}.log)
  714. endforeach(location_weight)
  715. endforeach(delete_cost_mod)
  716. endforeach(delete_cost_func)
  717. endforeach(subst_cost_mod)
  718. endforeach(subst_cost_func)
  719. endforeach(desc_size)
  720. endforeach(scalar_cmp)
  721. endforeach(serial_cmp)
  722. endforeach(feature)
  723. endif()
  724. if(${DO_RECALL_PRECISION_IFNC5I300_TESTS})
  725. set (RP_INPUT_DIR ../../../experiments/ifnenit_C5_I300/)
  726. set (RP_OUTPUT_DIR ../../../experiments/rp/results/ifnenit_C5_I300/)
  727. set (RP_FEATURES shape-context)
  728. # set (RP_FEATURES contour-line-pair contour-single-line shape-context sift surf freak chamfer profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
  729. # set (RP_FEATURES ${ALL_SERIAL_FEATURES})
  730. set (RP_SERIAL_COMPARATORS minimums dynamic-minimums)
  731. set (RP_SCALAR_COMPARATORS euclidean)
  732. add_custom_command(TARGET retrieval-recall-precision
  733. POST_BUILD
  734. COMMAND mkdir -p ${RP_OUTPUT_DIR})
  735. foreach(feature ${RP_FEATURES})
  736. foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
  737. foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
  738. foreach(desc_size 4)
  739. foreach(subst_cost_func const)
  740. foreach(subst_cost_mod 1)
  741. foreach(delete_cost_func pow)
  742. foreach(delete_cost_mod 2)
  743. foreach(location_weight 1.6)
  744. string(RANDOM outfile_suffix)
  745. set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
  746. add_custom_command(TARGET retrieval-recall-precision
  747. POST_BUILD
  748. COMMAND echo Processing: ${output_file})
  749. add_custom_command(TARGET retrieval-recall-precision
  750. POST_BUILD
  751. COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-use-feature-pool > ${output_file}.log
  752. )
  753. add_custom_command(TARGET retrieval-recall-precision
  754. POST_BUILD
  755. COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
  756. add_custom_command(TARGET retrieval-recall-precision
  757. POST_BUILD
  758. COMMAND rm ${output_file}.log)
  759. add_custom_command(TARGET retrieval-recall-precision
  760. POST_BUILD
  761. COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
  762. endforeach(location_weight)
  763. endforeach(delete_cost_mod)
  764. endforeach(delete_cost_func)
  765. endforeach(subst_cost_mod)
  766. endforeach(subst_cost_func)
  767. endforeach(desc_size)
  768. endforeach(scalar_cmp)
  769. endforeach(serial_cmp)
  770. endforeach(feature)
  771. endif()
  772. if(${DO_RECALL_PRECISION_IFNC44I1000_TESTS})
  773. set (RP_INPUT_DIR ../../../experiments/ifnenit_C44_I1000/)
  774. set (RP_OUTPUT_DIR ../../../experiments/rp/results/ifnenit_C44_I1000/)
  775. # set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
  776. set (RP_FEATURES contour-line-pair contour-single-line shape-context sift surf freak chamfer profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
  777. set (RP_SERIAL_COMPARATORS dynamic-minimums minimums matching-minimums)
  778. set (RP_SCALAR_COMPARATORS euclidean)
  779. add_custom_command(TARGET retrieval-recall-precision
  780. POST_BUILD
  781. COMMAND mkdir -p ${RP_OUTPUT_DIR})
  782. foreach(feature ${RP_FEATURES})
  783. foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
  784. foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
  785. foreach(desc_size 4)
  786. foreach(subst_cost_func const)
  787. foreach(subst_cost_mod 1)
  788. foreach(delete_cost_func const)
  789. foreach(delete_cost_mod 5)
  790. foreach(location_weight 1.6)
  791. string(RANDOM outfile_suffix)
  792. set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
  793. add_custom_command(TARGET retrieval-recall-precision
  794. POST_BUILD
  795. COMMAND echo Processing: ${output_file})
  796. add_custom_command(TARGET retrieval-recall-precision
  797. POST_BUILD
  798. COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-use-feature-pool > ${output_file}.log
  799. )
  800. add_custom_command(TARGET retrieval-recall-precision
  801. POST_BUILD
  802. COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
  803. add_custom_command(TARGET retrieval-recall-precision
  804. POST_BUILD
  805. COMMAND rm ${output_file}.log)
  806. add_custom_command(TARGET retrieval-recall-precision
  807. POST_BUILD
  808. COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
  809. endforeach(location_weight)
  810. endforeach(delete_cost_mod)
  811. endforeach(delete_cost_func)
  812. endforeach(subst_cost_mod)
  813. endforeach(subst_cost_func)
  814. endforeach(desc_size)
  815. endforeach(scalar_cmp)
  816. endforeach(serial_cmp)
  817. endforeach(feature)
  818. endif()
  819. if(${DO_RECALL_PRECISION_DEBUG_TESTS})
  820. set (RP_INPUT_DIR ../../../experiments/rp/test/)
  821. set (RP_OUTPUT_DIR ../../../experiments/rp/results/test/)
  822. set (RP_FEATURES contour-line-pair profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
  823. set (RP_SERIAL_COMPARATORS dynamic-minimums minimums)
  824. set (RP_SCALAR_COMPARATORS euclidean)
  825. add_custom_command(TARGET retrieval-recall-precision
  826. POST_BUILD
  827. COMMAND mkdir -p ${RP_OUTPUT_DIR})
  828. foreach(feature ${RP_FEATURES})
  829. foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
  830. foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
  831. string(RANDOM outfile_suffix)
  832. set(output-file ${RP_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp}-${outfile_suffix}.csv)
  833. add_custom_command(TARGET retrieval-recall-precision
  834. POST_BUILD
  835. COMMAND echo Processing: ${feature}-${serial_cmp}-${scalar_cmp})
  836. add_custom_command(TARGET retrieval-recall-precision
  837. POST_BUILD
  838. COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output-file} --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --wordspot-aggregate-query > ${output-file}.log )
  839. endforeach(scalar_cmp)
  840. endforeach(serial_cmp)
  841. endforeach(feature)
  842. endif()