Guest User

Untitled

a guest
May 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.64 KB | None | 0 0
  1. # ***************************************************************** #
  2. # SSH: Single Stage Headless Face Detector
  3. # Test Prototxt
  4. # Written by Mahyar Najibi
  5. # ***************************************************************** #
  6.  
  7. name: "TinySSH"
  8.  
  9. input: "data"
  10. input_shape {
  11. dim: 1
  12. dim: 3
  13. dim: 300
  14. dim: 400
  15. }
  16.  
  17. input: "im_info"
  18. input_shape {
  19. dim: 1
  20. dim: 3
  21. }
  22.  
  23. layer {
  24. name: "conv1_1"
  25. type: "Convolution"
  26. bottom: "data"
  27. top: "conv1_1"
  28. param {
  29. lr_mult: 0
  30. decay_mult: 0
  31. }
  32. param {
  33. lr_mult: 0
  34. decay_mult: 0
  35. }
  36. convolution_param {
  37. num_output: 16
  38. pad: 1
  39. kernel_size: 3
  40. weight_filler { type: "gaussian" std: 0.01 }
  41. bias_filler { type: "constant" value: 0 }
  42. }
  43. }
  44. layer {
  45. name: "relu1_1"
  46. type: "ReLU"
  47. bottom: "conv1_1"
  48. top: "conv1_1"
  49. }
  50. layer {
  51. name: "pool1"
  52. type: "Pooling"
  53. bottom: "conv1_1"
  54. top: "pool1"
  55. pooling_param {
  56. pool: MAX
  57. kernel_size: 2
  58. stride: 2
  59. }
  60. }
  61. layer {
  62. name: "conv2_1"
  63. type: "Convolution"
  64. bottom: "pool1"
  65. top: "conv2_1"
  66. param {
  67. lr_mult: 0
  68. decay_mult: 0
  69. }
  70. param {
  71. lr_mult: 0
  72. decay_mult: 0
  73. }
  74. convolution_param {
  75. num_output: 32
  76. pad: 1
  77. kernel_size: 3
  78. weight_filler { type: "gaussian" std: 0.01 }
  79. bias_filler { type: "constant" value: 0 }
  80. }
  81. }
  82. layer {
  83. name: "relu2_1"
  84. type: "ReLU"
  85. bottom: "conv2_1"
  86. top: "conv2_1"
  87. }
  88. layer {
  89. name: "pool2"
  90. type: "Pooling"
  91. bottom: "conv2_1"
  92. top: "pool2"
  93. pooling_param {
  94. pool: MAX
  95. kernel_size: 2
  96. stride: 2
  97. }
  98. }
  99. layer {
  100. name: "conv3_1"
  101. type: "Convolution"
  102. bottom: "pool2"
  103. top: "conv3_1"
  104. param {
  105. lr_mult: 1
  106. }
  107. param {
  108. lr_mult: 2
  109. }
  110. convolution_param {
  111. num_output: 64
  112. pad: 1
  113. kernel_size: 3
  114. weight_filler { type: "gaussian" std: 0.01 }
  115. bias_filler { type: "constant" value: 0 }
  116. }
  117. }
  118. layer {
  119. name: "relu3_1"
  120. type: "ReLU"
  121. bottom: "conv3_1"
  122. top: "conv3_1"
  123. }
  124. layer {
  125. name: "pool3"
  126. type: "Pooling"
  127. bottom: "conv3_1"
  128. top: "pool3"
  129. pooling_param {
  130. pool: MAX
  131. kernel_size: 2
  132. stride: 2
  133. }
  134. }
  135. layer {
  136. name: "conv4_1"
  137. type: "Convolution"
  138. bottom: "pool3"
  139. top: "conv4_1"
  140. param {
  141. lr_mult: 1
  142. }
  143. param {
  144. lr_mult: 2
  145. }
  146. convolution_param {
  147. num_output: 128
  148. pad: 1
  149. kernel_size: 3
  150. weight_filler { type: "gaussian" std: 0.01 }
  151. bias_filler { type: "constant" value: 0 }
  152. }
  153. }
  154. layer {
  155. name: "relu4_1"
  156. type: "ReLU"
  157. bottom: "conv4_1"
  158. top: "conv4_1"
  159. }
  160. layer {
  161. name: "pool4"
  162. type: "Pooling"
  163. bottom: "conv4_1"
  164. top: "pool4"
  165. pooling_param {
  166. pool: MAX
  167. kernel_size: 2
  168. stride: 2
  169. }
  170. }
  171. layer {
  172. name: "conv5_1"
  173. type: "Convolution"
  174. bottom: "pool4"
  175. top: "conv5_1"
  176. param {
  177. lr_mult: 1
  178. }
  179. param {
  180. lr_mult: 2
  181. }
  182. convolution_param {
  183. num_output: 128
  184. pad: 1
  185. kernel_size: 3
  186. weight_filler { type: "gaussian" std: 0.01 }
  187. bias_filler { type: "constant" value: 0 }
  188. }
  189. }
  190. layer {
  191. name: "relu5_1"
  192. type: "ReLU"
  193. bottom: "conv5_1"
  194. top: "conv5_1"
  195. }
  196. layer {
  197. name: "pool5"
  198. type: "Pooling"
  199. bottom: "conv5_1"
  200. top: "pool5"
  201. pooling_param {
  202. pool: MAX
  203. kernel_size: 2
  204. stride: 2
  205. }
  206. }
  207.  
  208.  
  209.  
  210.  
  211. #========== M3@SSH =========
  212. layer {
  213. name: "m3@ssh_3x3"
  214. type: "Convolution"
  215. bottom: "pool5"
  216. top: "m3@ssh_3x3_output"
  217. param { lr_mult: 1.0 decay_mult: 1.0 name:'m3@ssh_3x3_param1'}
  218. param { lr_mult: 2.0 decay_mult: 0 name:'m3@ssh_3x3_param2'}
  219. convolution_param {
  220. num_output: 64
  221. kernel_size: 3 pad: 1 stride: 1
  222. weight_filler { type: "gaussian" std: 0.01 }
  223. bias_filler { type: "constant" value: 0 }
  224. }
  225. }
  226. # Dim red
  227. layer {
  228. name: "m3@ssh_dimred"
  229. type: "Convolution"
  230. bottom: "pool5"
  231. top: "m3@ssh_dimred_output"
  232. param { lr_mult: 1.0 decay_mult: 1.0 name: 'm3@ssh_dimred_param1' }
  233. param { lr_mult: 2.0 decay_mult: 0 name: 'm3@ssh_dimred_param2'}
  234. convolution_param {
  235. num_output: 32
  236. kernel_size: 3 pad: 1 stride: 1
  237. weight_filler { type: "gaussian" std: 0.01 }
  238. bias_filler { type: "constant" value: 0 }
  239. }
  240. }
  241. layer {
  242. name: "m3@ssh_dimred_relu"
  243. type: "ReLU"
  244. bottom: "m3@ssh_dimred_output"
  245. top: "m3@ssh_dimred_output"
  246. }
  247. # 5x5
  248. layer {
  249. name: "m3@ssh_5x5"
  250. type: "Convolution"
  251. bottom: "m3@ssh_dimred_output"
  252. top: "m3@ssh_5x5_output"
  253. param { lr_mult: 1.0 decay_mult: 1.0 name: 'm3@ssh_5x5_param1'}
  254. param { lr_mult: 2.0 decay_mult: 0 name: 'm3@ssh_5x5_param2'}
  255. convolution_param {
  256. num_output: 32
  257. kernel_size: 3 pad: 1 stride: 1
  258. weight_filler { type: "gaussian" std: 0.01 }
  259. bias_filler { type: "constant" value: 0 }
  260. }
  261. }
  262. #7x7
  263. layer {
  264. name: "m3@ssh_7x7-1"
  265. type: "Convolution"
  266. bottom: "m3@ssh_dimred_output"
  267. top: "m3@ssh_7x7-1_output"
  268. param { lr_mult: 1.0 decay_mult: 1.0 name: 'm3@ssh_7x7-1_param1'}
  269. param { lr_mult: 2.0 decay_mult: 0 name: 'm3@ssh_7x7-1_param2'}
  270. convolution_param {
  271. num_output: 32
  272. kernel_size: 3 pad: 1 stride: 1
  273. weight_filler { type: "gaussian" std: 0.01 }
  274. bias_filler { type: "constant" value: 0 }
  275. }
  276. }
  277. layer {
  278. name: "m3@ssh_7x7-1_relu"
  279. type: "ReLU"
  280. bottom: "m3@ssh_7x7-1_output"
  281. top: "m3@ssh_7x7-1_output"
  282. }
  283. layer {
  284. name: "m3@ssh_7x7"
  285. type: "Convolution"
  286. bottom: "m3@ssh_7x7-1_output"
  287. top: "m3@ssh_7x7_output"
  288. param { lr_mult: 1.0 decay_mult: 1.0 name: 'm3@ssh_7x7_param1'}
  289. param { lr_mult: 2.0 decay_mult: 0 name: 'm3@ssh_7x7_param2'}
  290. convolution_param {
  291. num_output: 32
  292. kernel_size: 3 pad: 1 stride: 1
  293. weight_filler { type: "gaussian" std: 0.01 }
  294. bias_filler { type: "constant" value: 0 }
  295. }
  296. }
  297. layer{
  298. name: "m3@ssh_output"
  299. type: "Concat"
  300. bottom: "m3@ssh_3x3_output"
  301. bottom: "m3@ssh_5x5_output"
  302. bottom: "m3@ssh_7x7_output"
  303. top: "m3@ssh_output"
  304. concat_param{
  305. axis: 1
  306. }
  307. }
  308. layer {
  309. name: "m3@ssh_output_relu"
  310. type: "ReLU"
  311. bottom: "m3@ssh_output"
  312. top: "m3@ssh_output"
  313. }
  314. layer {
  315. name: "m3@ssh_cls_score"
  316. type: "Convolution"
  317. bottom: "m3@ssh_output"
  318. top: "m3@ssh_cls_score_output"
  319. param { lr_mult: 1.0 decay_mult: 1.0 name: 'm3@ssh_cls_score_param1'}
  320. param { lr_mult: 2.0 decay_mult: 0 name: 'm3@ssh_cls_score_param2'}
  321. convolution_param {
  322. num_output: 4 # 2(bg/fg) * 21(anchors)
  323. kernel_size: 1 pad: 0 stride: 1
  324. weight_filler { type: "gaussian" std: 0.01 }
  325. bias_filler { type: "constant" value: 0 }
  326. }
  327. }
  328. layer {
  329. name: "m3@ssh_bbox_pred"
  330. type: "Convolution"
  331. bottom: "m3@ssh_output"
  332. top: "m3@ssh_bbox_pred_output"
  333. param { lr_mult: 1.0 decay_mult: 1.0}
  334. param { lr_mult: 2.0 decay_mult: 0}
  335. convolution_param {
  336. num_output: 8
  337. kernel_size: 1 pad: 0 stride: 1
  338. weight_filler { type: "gaussian" std: 0.01 }
  339. bias_filler { type: "constant" value: 0 }
  340. }
  341. }
  342. layer {
  343. name: "m3@ssh_cls_reshape"
  344. type: "Reshape"
  345. bottom: "m3@ssh_cls_score_output"
  346. top: "m3@ssh_cls_score_reshape_output"
  347. reshape_param { shape { dim: 0 dim: 2 dim: -1 dim: 0 } }
  348. }
  349. layer {
  350. name: "m3@ssh_cls_prob"
  351. type: "Softmax"
  352. bottom: "m3@ssh_cls_score_reshape_output"
  353. top: "m3@ssh_cls_prob_output"
  354. }
  355. layer {
  356. name: 'm3@ssh_cls_prob_reshape'
  357. type: 'Reshape'
  358. bottom: 'm3@ssh_cls_prob_output'
  359. top: 'm3@ssh_cls_prob_reshape_output'
  360. reshape_param { shape { dim: 0 dim:4 dim: -1 dim: 0 } }
  361. }
  362. layer {
  363. name: 'm3@ssh_proposal'
  364. type: 'Python'
  365. bottom: 'm3@ssh_cls_prob_reshape_output'
  366. bottom: 'm3@ssh_bbox_pred_output'
  367. bottom: 'im_info'
  368. top: 'm3@ssh_boxes'
  369. top: 'm3@ssh_cls_prob'
  370. python_param {
  371. module: 'SSH.layers.proposal_layer'
  372. layer: 'ProposalLayer'
  373. param_str: "{'feat_stride': 32, 'base_size': 4, 'scales': [32,64], 'ratios':[1,]}"
  374. }
  375. }
  376.  
  377.  
  378.  
  379.  
  380. # CONCAT ALL detections
  381. layer{
  382. name: "ssh_cls_prob"
  383. type: "Concat"
  384. bottom: "m3@ssh_cls_prob"
  385. top: "ssh_cls_prob"
  386. concat_param{
  387. axis: 0
  388. }
  389. }
  390.  
  391. layer{
  392. name: "ssh_boxes"
  393. type: "Concat"
  394. bottom: "m3@ssh_boxes"
  395. top: "ssh_boxes"
  396. concat_param{
  397. axis: 0
  398. }
  399. }
Add Comment
Please, Sign In to add comment