caffe-schema.js 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151
  1. /*jshint esversion: 6 */
  2. const fs = require('fs');
  3. const process = require('process');
  4. var file = process.argv[2];
  5. var data = fs.readFileSync(file, 'utf-8');
  6. function update(search, replace) {
  7. var parts = data.split(search);
  8. if (parts.length != 2) {
  9. console.log('ERROR: Replace failed.');
  10. process.exit(1);
  11. }
  12. data = parts.join(replace);
  13. }
  14. function add(text) {
  15. data += text;
  16. }
  17. update(
  18. ` CONVOLUTION = 4;`,
  19. ` CONVOLUTION = 4;
  20. CROP = 40;`);
  21. update(
  22. `message DropoutParameter {
  23. optional float dropout_ratio = 1 [default = 0.5]; // dropout ratio
  24. }`,
  25. `message DropoutParameter {
  26. optional float dropout_ratio = 1 [default = 0.5]; // dropout ratio
  27. optional bool sample_weights_test = 2 [default = false]; // Sample weights for testing or use the mean
  28. optional bool scale_train = 3 [default = true]; // scale train or test phase
  29. }`);
  30. update(
  31. ` optional WindowDataParameter window_data_param = 129;
  32. }`,
  33. ` optional string engine = 149 [default = ""];
  34. optional MultinodeLayerParameter multinode = 150;
  35. optional MnActivationParameter mn_activation_param = 151;
  36. optional BoxAnnotatorOHEMParameter box_annotator_ohem_param = 152;
  37. optional PSROIPoolingParameter psroi_pooling_param = 153;
  38. optional ROIPoolingParameter roi_pooling_param = 154; // 150 in yjxiong/caffe
  39. optional SpatialDropoutParameter spatial_dropout_param = 155;
  40. optional MnParamGradCompressParameter mn_grad_compress_param = 156;
  41. optional QuantizationParameter quantization_param = 158;
  42. optional ReorgParameter reorg_param = 159;
  43. optional BatchReductionParameter batch_reduction_param = 162;
  44. optional ShuffleChannelParameter shuffle_channel_param = 164;
  45. optional AnnotatedDataParameter annotated_data_param = 200;
  46. optional MultiBoxLossParameter multibox_loss_param = 201;
  47. optional PermuteParameter permute_param = 202;
  48. optional PriorBoxParameter prior_box_param = 203;
  49. optional DetectionOutputParameter detection_output_param = 204;
  50. optional DetectionEvaluateParameter detection_evaluate_param = 205;
  51. optional NormalizeParameter norm_param = 206;
  52. optional VideoDataParameter video_data_param = 207; // 140 in yjxiong/caffe
  53. optional SplitParameter split_param = 208;
  54. optional RegionLossParameter region_loss_param = 209;
  55. optional EvalDetectionParameter eval_detection_param = 301;
  56. optional YoloDetectionOutputParameter yolo_detection_output_param = 601; // eric612/MobileNet-YOLO
  57. optional Yolov3DetectionOutputParameter yolov3_detection_output_param = 602; // eric612/MobileNet-YOLO
  58. optional ROIPoolingParameter roi_pooling_param_2 = 8266711;
  59. optional NormalizeBBoxParameter normalize_bbox_param = 8266712; // 149
  60. optional BNParameter bn_param = 1137; // 41 in ChenglongChen/batch_normalization, 137 in yjxiong/caffe
  61. optional InterpParameter interp_param = 2143; // 143 indeeplab-public-ver2
  62. optional CoeffScheduleParameter coeff_schedule_param = 3148; // 148 synopsys-caffe
  63. optional AugmentationParameter augmentation_param = 3149; // // 149 synopsys-caffe
  64. optional CorrelationParameter correlation_param = 3150; // 150 synopsys-caffe
  65. optional L1LossParameter l1_loss_param = 3151; // 2151 synopsys-caffe
  66. optional WriterParameter writer_param = 3152; // 152 synopsys-caffe
  67. optional ReaderParameter reader_param = 3153; // 153 synopsys-caffe
  68. optional MeanParameter mean_param = 3154; // 154 synopsys-caffe
  69. optional ResampleParameter resample_param = 3155; // 155
  70. optional DownsampleParameter downsample_param = 3156; // 156
  71. optional LpqLossParameter lpq_loss_param = 3158; // 158
  72. optional FlowWarpParameter flow_warp_param = 3159; // 159
  73. optional AccumParameter accum_param = 3160; // 160
  74. optional BlackAugmentationParameter black_augmentation_param = 3161; // 161
  75. optional bool reshape_every_iter = 3157 [default = true]; // 162
  76. optional YoloV2LossParameter yolo_v2_loss_param = 3198; // 198
  77. optional YoloV3LossParameter yolo_v3_loss_param = 3199; // 199
  78. optional BoxOutputParameter box_output_param = 4151; // 151 in gdlg/panoramic-object-detection
  79. optional RingPadParameter ring_pad_param = 4158; // 158 in gdlg/panoramic-object-detection
  80. optional bool force_backward = 4000; // ???
  81. }`);
  82. update(
  83. ` optional uint32 crop_size = 3 [default = 0];
  84. // mean_file and mean_value cannot be specified at the same time
  85. optional string mean_file = 4;
  86. // if specified can be repeated once (would subtract it from all the channels)
  87. // or can be repeated the same number of times as channels
  88. // (would subtract them from the corresponding channel)
  89. repeated float mean_value = 5;
  90. // Force the decoded image to have 3 color channels.
  91. optional bool force_color = 6 [default = false];
  92. // Force the decoded image to have 1 color channels.
  93. optional bool force_gray = 7 [default = false];
  94. }`,
  95. ` optional uint32 crop_size = 3 [default = 0];
  96. optional uint32 crop_h = 11 [default = 0];
  97. optional uint32 crop_w = 12 [default = 0];
  98. // mean_file and mean_value cannot be specified at the same time
  99. optional string mean_file = 4;
  100. // if specified can be repeated once (would substract it from all the channels)
  101. // or can be repeated the same number of times as channels
  102. // (would subtract them from the corresponding channel)
  103. repeated float mean_value = 5;
  104. // Force the decoded image to have 3 color channels.
  105. optional bool force_color = 6 [default = false];
  106. // Force the decoded image to have 1 color channels.
  107. optional bool force_gray = 7 [default = false];
  108. // Resize policy
  109. optional ResizeParameter resize_param = 8;
  110. // Noise policy
  111. optional NoiseParameter noise_param = 9;
  112. // Distortion policy
  113. optional DistortionParameter distort_param = 13;
  114. // Expand policy
  115. optional ExpansionParameter expand_param = 14;
  116. // Constraint for emitting the annotation after transformation.
  117. optional EmitConstraint emit_constraint = 10;
  118. // Resize the input randomly
  119. optional RandomResizeParameter random_resize_param = 15;
  120. optional RandomAspectRatioParameter random_aspect_ratio_param = 16;
  121. //will flip x flow if flow image input
  122. optional bool flow = 17 [default = false];
  123. optional bool bgr2rgb = 18 [ default = false ];
  124. }
  125. // Message that stores parameters used by data transformer for transformation
  126. // policy
  127. message NoiseParameter {
  128. //Probability of using this resize policy
  129. optional float prob = 1 [default = 0];
  130. // Histogram equalized
  131. optional bool hist_eq = 2 [default = false];
  132. // Color inversion
  133. optional bool inverse = 3 [default = false];
  134. // Grayscale
  135. optional bool decolorize = 4 [default = false];
  136. // Gaussian blur
  137. optional bool gauss_blur = 5 [default = false];
  138. // JPEG compression quality (-1 = no compression)
  139. optional float jpeg = 6 [default = -1];
  140. // Posterization
  141. optional bool posterize = 7 [default = false];
  142. // Erosion
  143. optional bool erode = 8 [default = false];
  144. // Salt-and-pepper noise
  145. optional bool saltpepper = 9 [default = false];
  146. optional SaltPepperParameter saltpepper_param = 10;
  147. // Local histogram equalization
  148. optional bool clahe = 11 [default = false];
  149. // Color space conversion
  150. optional bool convert_to_hsv = 12 [default = false];
  151. // Color space conversion
  152. optional bool convert_to_lab = 13 [default = false];
  153. }
  154. // Message that stores parameters used by data transformer for distortion policy
  155. message DistortionParameter {
  156. // The probability of adjusting brightness.
  157. optional float brightness_prob = 1 [default = 0.0];
  158. // Amount to add to the pixel values within [-delta, delta].
  159. // The possible value is within [0, 255]. Recommend 32.
  160. optional float brightness_delta = 2 [default = 0.0];
  161. // The probability of adjusting contrast.
  162. optional float contrast_prob = 3 [default = 0.0];
  163. // Lower bound for random contrast factor. Recommend 0.5.
  164. optional float contrast_lower = 4 [default = 0.0];
  165. // Upper bound for random contrast factor. Recommend 1.5.
  166. optional float contrast_upper = 5 [default = 0.0];
  167. // The probability of adjusting hue.
  168. optional float hue_prob = 6 [default = 0.0];
  169. // Amount to add to the hue channel within [-delta, delta].
  170. // The possible value is within [0, 180]. Recommend 36.
  171. optional float hue_delta = 7 [default = 0.0];
  172. // The probability of adjusting saturation.
  173. optional float saturation_prob = 8 [default = 0.0];
  174. // Lower bound for the random saturation factor. Recommend 0.5.
  175. optional float saturation_lower = 9 [default = 0.0];
  176. // Upper bound for the random saturation factor. Recommend 1.5.
  177. optional float saturation_upper = 10 [default = 0.0];
  178. // The probability of randomly order the image channels.
  179. optional float random_order_prob = 11 [default = 0.0];
  180. }
  181. // Message that stores parameters used by data transformer for expansion policy
  182. message ExpansionParameter {
  183. //Probability of using this expansion policy
  184. optional float prob = 1 [default = 1];
  185. // The ratio to expand the image.
  186. optional float max_expand_ratio = 2 [default = 1.];
  187. }
  188. // Condition for emitting annotations.
  189. message EmitConstraint {
  190. enum EmitType {
  191. CENTER = 0;
  192. MIN_OVERLAP = 1;
  193. }
  194. optional EmitType emit_type = 1 [default = CENTER];
  195. // If emit_type is MIN_OVERLAP, provide the emit_overlap.
  196. optional float emit_overlap = 2;
  197. }
  198. message RandomResizeParameter {
  199. optional uint32 min_size = 1 [default = 0];
  200. optional uint32 max_size = 2 [default = 0];
  201. optional ResizeParameter resize_param = 3;
  202. }
  203. message RandomAspectRatioParameter {
  204. optional float min_area_ratio = 1 [default = 0.5];
  205. optional float max_area_ratio = 2 [default = 1];
  206. optional float aspect_ratio_change = 3 [default = 1];
  207. optional uint32 max_attempt = 4 [default = 10];
  208. optional ResizeParameter resize_param = 5;
  209. }
  210. message SaltPepperParameter {
  211. //Percentage of pixels
  212. optional float fraction = 1 [default = 0];
  213. repeated float value = 2;
  214. }
  215. message BNParameter {
  216. optional FillerParameter slope_filler = 1;
  217. optional FillerParameter bias_filler = 2;
  218. optional float momentum = 3 [default = 0.9];
  219. optional float eps = 4 [default = 1e-5];
  220. // If true, will use the moving average mean and std for training and test.
  221. // Will override the lr_param and freeze all the parameters.
  222. // Make sure to initialize the layer properly with pretrained parameters.
  223. optional bool frozen = 5 [default = false];
  224. enum Engine {
  225. DEFAULT = 0;
  226. CAFFE = 1;
  227. CUDNN = 2;
  228. }
  229. optional Engine engine = 6 [default = DEFAULT];
  230. }
  231. message BatchReductionParameter {
  232. repeated int32 level = 1;
  233. optional ReductionParameter reduction_param = 2;
  234. optional bool pos = 3 [default = false];
  235. }
  236. // Message that stores parameters used by InterpLayer
  237. message InterpParameter {
  238. optional int32 height = 1 [default = 0]; // Height of output
  239. optional int32 width = 2 [default = 0]; // Width of output
  240. optional int32 zoom_factor = 3 [default = 1]; // zoom factor
  241. optional int32 shrink_factor = 4 [default = 1]; // shrink factor
  242. optional int32 pad_beg = 5 [default = 0]; // padding at begin of input
  243. optional int32 pad_end = 6 [default = 0]; // padding at end of input
  244. }
  245. `);
  246. update(
  247. ` // kernel_h = bottom->height and kernel_w = bottom->width
  248. optional bool global_pooling = 12 [default = false];
  249. `,
  250. ` // kernel_h = bottom->height and kernel_w = bottom->width
  251. optional bool global_pooling = 12 [default = false];
  252. // Specify floor/ceil mode
  253. optional bool ceil_mode = 1013 [default = true]; // 13 in https://github.com/BVLC/caffe/pull/3057
  254. `);
  255. // foss-for-synopsys-dwc-arc-processors/synopsys-caffe
  256. update(
  257. ` // Prefetch queue (Increase if data feeding bandwidth varies, within the
  258. // limit of device memory for GPU training)
  259. optional uint32 prefetch = 10 [default = 4];
  260. `,
  261. ` // Prefetch queue (Increase if data feeding bandwidth varies, within the
  262. // limit of device memory for GPU training)
  263. optional uint32 prefetch = 10 [default = 4];
  264. //To store last layer feature map size for yolo
  265. repeated uint32 side = 11;
  266. // Read data from BinaryDB files using multiple threads. If this parameter
  267. // is set to ZERO, each top blob will get a separate thread.
  268. optional uint32 disk_reader_threads = 4001 [default = 1];
  269. // If set to true, BinaryDB uses a pretty fast method for initializing the source data.
  270. // Without this BinaryDB practically fails to load huge datasets.
  271. optional bool huge_video_dataset = 7000 [default = false];
  272. // Use a non-negative value, to load only this number of dataset samples in binarydb_*
  273. optional int32 limit_samples = 7001 [default = -1];
  274. optional string preselection_file = 3001; // Load a text file which specifies a label for each data sample. Use preselection_label to filter the data for one specific label.
  275. optional int32 preselection_label = 3002;
  276. optional int32 range_start = 3003 [default = 0]; //0 = start with first
  277. optional int32 range_end = 3004 [default = -1]; //-1 = go until end
  278. optional bool rand_permute = 3005 [default = false];
  279. optional RANDPERMORDER rand_permute_order = 3006 [default = FIRST_PERMUTE_THEN_RANGE]; // permute indices first, then extract range (or other way around)
  280. optional uint32 rand_permute_seed = 3007 [default = 0]; // In BinaryDB (and webp), 0 means using timer randomization!
  281. repeated uint32 slice_point = 3008;
  282. repeated CHANNELENCODING encoding = 3009;
  283. optional bool verbose = 3010 [default = false];
  284. repeated float subtract = 3011;
  285. optional uint32 permute_every_iter = 3012 [default = 0];
  286. optional uint32 block_size = 3013 [default = 0];
  287. enum RANDPERMORDER {
  288. FIRST_PERMUTE_THEN_RANGE = 0;
  289. FIRST_RANGE_THEN_PERMUTE = 1;
  290. }
  291. enum CHANNELENCODING {
  292. UINT8 = 1;
  293. UINT16FLOW = 2;
  294. BOOL1 = 3;
  295. }
  296. `)
  297. add(
  298. `
  299. // Sample a bbox in the normalized space [0, 1] with provided constraints.
  300. message Sampler {
  301. // Minimum scale of the sampled bbox.
  302. optional float min_scale = 1 [default = 1.];
  303. // Maximum scale of the sampled bbox.
  304. optional float max_scale = 2 [default = 1.];
  305. // Minimum aspect ratio of the sampled bbox.
  306. optional float min_aspect_ratio = 3 [default = 1.];
  307. // Maximum aspect ratio of the sampled bbox.
  308. optional float max_aspect_ratio = 4 [default = 1.];
  309. }
  310. // Constraints for selecting sampled bbox.
  311. message SampleConstraint {
  312. // Minimum Jaccard overlap between sampled bbox and all bboxes in
  313. // AnnotationGroup.
  314. optional float min_jaccard_overlap = 1;
  315. // Maximum Jaccard overlap between sampled bbox and all bboxes in
  316. // AnnotationGroup.
  317. optional float max_jaccard_overlap = 2;
  318. // Minimum coverage of sampled bbox by all bboxes in AnnotationGroup.
  319. optional float min_sample_coverage = 3;
  320. // Maximum coverage of sampled bbox by all bboxes in AnnotationGroup.
  321. optional float max_sample_coverage = 4;
  322. // Minimum coverage of all bboxes in AnnotationGroup by sampled bbox.
  323. optional float min_object_coverage = 5;
  324. // Maximum coverage of all bboxes in AnnotationGroup by sampled bbox.
  325. optional float max_object_coverage = 6;
  326. }
  327. // Sample a batch of bboxes with provided constraints.
  328. message BatchSampler {
  329. // Use original image as the source for sampling.
  330. optional bool use_original_image = 1 [default = true];
  331. // Constraints for sampling bbox.
  332. optional Sampler sampler = 2;
  333. // Constraints for determining if a sampled bbox is positive or negative.
  334. optional SampleConstraint sample_constraint = 3;
  335. // If provided, break when found certain number of samples satisfing the
  336. // sample_constraint.
  337. optional uint32 max_sample = 4;
  338. // Maximum number of trials for sampling to avoid infinite loop.
  339. optional uint32 max_trials = 5 [default = 100];
  340. }
  341. message NonMaximumSuppressionParameter {
  342. // Threshold to be used in nms.
  343. optional float nms_threshold = 1 [default = 0.3];
  344. // Maximum number of results to be kept.
  345. optional int32 top_k = 2;
  346. // Parameter for adaptive nms.
  347. optional float eta = 3 [default = 1.0];
  348. }
  349. message SaveOutputParameter {
  350. // Output directory. If not empty, we will save the results.
  351. optional string output_directory = 1;
  352. // Output name prefix.
  353. optional string output_name_prefix = 2;
  354. // Output format.
  355. // VOC - PASCAL VOC output format.
  356. // COCO - MS COCO output format.
  357. optional string output_format = 3;
  358. // If you want to output results, must also provide the following two files.
  359. // Otherwise, we will ignore saving results.
  360. // label map file.
  361. optional string label_map_file = 4;
  362. // A file which contains a list of names and sizes with same order
  363. // of the input DB. The file is in the following format:
  364. // name height width
  365. // ...
  366. optional string name_size_file = 5;
  367. // Number of test images. It can be less than the lines specified in
  368. // name_size_file. For example, when we only want to evaluate on part
  369. // of the test images.
  370. optional uint32 num_test_image = 6;
  371. // The resize parameter used in saving the data.
  372. optional ResizeParameter resize_param = 7;
  373. }
  374. // Message that stores parameters used by data transformer for resize policy
  375. message ResizeParameter {
  376. //Probability of using this resize policy
  377. optional float prob = 1 [default = 1];
  378. enum Resize_mode {
  379. WARP = 1;
  380. FIT_SMALL_SIZE = 2;
  381. FIT_LARGE_SIZE_AND_PAD = 3;
  382. }
  383. optional Resize_mode resize_mode = 2 [default = WARP];
  384. optional uint32 height = 3 [default = 0];
  385. optional uint32 width = 4 [default = 0];
  386. // A parameter used to update bbox in FIT_SMALL_SIZE mode.
  387. optional uint32 height_scale = 8 [default = 0];
  388. optional uint32 width_scale = 9 [default = 0];
  389. enum Pad_mode {
  390. CONSTANT = 1;
  391. MIRRORED = 2;
  392. REPEAT_NEAREST = 3;
  393. }
  394. // Padding mode for BE_SMALL_SIZE_AND_PAD mode and object centering
  395. optional Pad_mode pad_mode = 5 [default = CONSTANT];
  396. // if specified can be repeated once (would fill all the channels)
  397. // or can be repeated the same number of times as channels
  398. // (would use it them to the corresponding channel)
  399. repeated float pad_value = 6;
  400. enum Interp_mode { //Same as in OpenCV
  401. LINEAR = 1;
  402. AREA = 2;
  403. NEAREST = 3;
  404. CUBIC = 4;
  405. LANCZOS4 = 5;
  406. }
  407. //interpolation for for resizing
  408. repeated Interp_mode interp_mode = 7;
  409. }
  410. // The normalized bounding box [0, 1] w.r.t. the input image size.
  411. message NormalizedBBox {
  412. optional float xmin = 1;
  413. optional float ymin = 2;
  414. optional float xmax = 3;
  415. optional float ymax = 4;
  416. optional int32 label = 5;
  417. optional bool difficult = 6;
  418. optional float score = 7;
  419. optional float size = 8;
  420. }
  421. // Annotation for each object instance.
  422. message Annotation {
  423. optional int32 instance_id = 1 [default = 0];
  424. optional NormalizedBBox bbox = 2;
  425. }
  426. // Group of annotations for a particular label.
  427. message AnnotationGroup {
  428. optional int32 group_label = 1;
  429. repeated Annotation annotation = 2;
  430. }
  431. // An extension of Datum which contains "rich" annotations.
  432. message AnnotatedDatum {
  433. enum AnnotationType {
  434. BBOX = 0;
  435. }
  436. optional Datum datum = 1;
  437. // If there are "rich" annotations, specify the type of annotation.
  438. // Currently it only supports bounding box.
  439. // If there are no "rich" annotations, use label in datum instead.
  440. optional AnnotationType type = 2;
  441. // Each group contains annotation for a particular class.
  442. repeated AnnotationGroup annotation_group = 3;
  443. }
  444. message MultinodeLayerParameter {
  445. // 0 means all nodes
  446. optional uint32 num_nodes = 1;
  447. // 0 or > num_nodes, means all nodes
  448. optional uint32 model_parts = 2 [default = 1];
  449. }
  450. message MnActivationParameter {
  451. // 0 means all nodes
  452. optional uint32 num_nodes_in = 1;
  453. // 0 means all nodes
  454. optional uint32 num_nodes_out = 2;
  455. // 0 or > num_nodes, means all nodes
  456. optional uint32 model_parts_in = 3 [default = 1];
  457. // 0 or > num_nodes, means all nodes
  458. optional uint32 model_parts_out = 4 [default = 1];
  459. optional bool need_reduce = 5 [default = true];
  460. }
  461. message BoxAnnotatorOHEMParameter {
  462. required uint32 roi_per_img = 1; // number of rois for training
  463. optional int32 ignore_label = 2 [default = -1]; // ignore_label in scoring
  464. }
  465. message PSROIPoolingParameter {
  466. required float spatial_scale = 1;
  467. required int32 output_dim = 2; // output channel number
  468. required int32 group_size = 3; // number of groups to encode position-sensitive score maps
  469. }
  470. // Message that stores parameters used by ROIPoolingLayer
  471. message ROIPoolingParameter {
  472. // Pad, kernel size, and stride are all given as a single value for equal
  473. // dimensions in height and width or as Y, X pairs.
  474. optional uint32 pooled_h = 1 [default = 0]; // The pooled output height
  475. optional uint32 pooled_w = 2 [default = 0]; // The pooled output width
  476. // Multiplicative spatial scale factor to translate ROI coords from their
  477. // input scale to the scale used when pooling
  478. optional float spatial_scale = 3 [default = 1];
  479. repeated uint32 pooled_size = 4; // pooled size for 3D blobs
  480. optional float pad_ratio = 6 [default = 0]; // 4 in gdlg/panoramic-object-detection
  481. optional bool ringpad = 5 [default = false]; // gdlg/panoramic-object-detection
  482. }
  483. message SpatialDropoutParameter {
  484. optional float dropout_ratio = 1 [default = 0.5]; // dropout ratio
  485. }
  486. message MnParamGradCompressParameter {
  487. repeated bool param_grad_compress_enable = 1;
  488. }
  489. // Message for layers with reduced word with arithmetic
  490. message QuantizationParameter{
  491. enum Precision {
  492. DYNAMIC_FIXED_POINT = 0;
  493. }
  494. optional Precision precision = 1 [default = DYNAMIC_FIXED_POINT];
  495. enum Rounding {
  496. NEAREST = 0;
  497. }
  498. optional Rounding rounding_scheme = 2 [default = NEAREST];
  499. // Dynamic fixed point word width
  500. optional uint32 bw_layer_in = 3 [default = 32];
  501. optional uint32 bw_layer_out = 4 [default = 32];
  502. optional uint32 bw_params = 5 [default = 32];
  503. repeated int32 fl_layer_in = 6;
  504. repeated int32 fl_layer_out = 7;
  505. repeated int32 fl_params = 8;
  506. repeated float scale_in = 20;
  507. repeated float scale_out = 21;
  508. repeated float scale_params = 22;
  509. }
  510. message ReorgParameter {
  511. optional uint32 stride = 1;
  512. optional bool reverse = 2 [default = false];
  513. }
  514. message AnnotatedDataParameter {
  515. // Define the sampler.
  516. repeated BatchSampler batch_sampler = 1;
  517. // Store label name and label id in LabelMap format.
  518. optional string label_map_file = 2;
  519. // If provided, it will replace the AnnotationType stored in each
  520. // AnnotatedDatum.
  521. optional AnnotatedDatum.AnnotationType anno_type = 3;
  522. }
  523. // Message that store parameters used by MultiBoxLossLayer
  524. message MultiBoxLossParameter {
  525. // Localization loss type.
  526. enum LocLossType {
  527. L2 = 0;
  528. SMOOTH_L1 = 1;
  529. }
  530. optional LocLossType loc_loss_type = 1 [default = SMOOTH_L1];
  531. // Confidence loss type.
  532. enum ConfLossType {
  533. SOFTMAX = 0;
  534. LOGISTIC = 1;
  535. }
  536. optional ConfLossType conf_loss_type = 2 [default = SOFTMAX];
  537. // Weight for localization loss.
  538. optional float loc_weight = 3 [default = 1.0];
  539. // Number of classes to be predicted. Required!
  540. optional uint32 num_classes = 4;
  541. // If true, bounding box are shared among different classes.
  542. optional bool share_location = 5 [default = true];
  543. // Matching method during training.
  544. enum MatchType {
  545. BIPARTITE = 0;
  546. PER_PREDICTION = 1;
  547. }
  548. optional MatchType match_type = 6 [default = PER_PREDICTION];
  549. // If match_type is PER_PREDICTION, use overlap_threshold to
  550. // determine the extra matching bboxes.
  551. optional float overlap_threshold = 7 [default = 0.5];
  552. // Use prior for matching.
  553. optional bool use_prior_for_matching = 8 [default = true];
  554. // Background label id.
  555. optional uint32 background_label_id = 9 [default = 0];
  556. // If true, also consider difficult ground truth.
  557. optional bool use_difficult_gt = 10 [default = true];
  558. // If true, perform negative mining.
  559. // DEPRECATED: use mining_type instead.
  560. optional bool do_neg_mining = 11;
  561. // The negative/positive ratio.
  562. optional float neg_pos_ratio = 12 [default = 3.0];
  563. // The negative overlap upperbound for the unmatched predictions.
  564. optional float neg_overlap = 13 [default = 0.5];
  565. // Type of coding method for bbox.
  566. optional PriorBoxParameter.CodeType code_type = 14 [default = CORNER];
  567. // If true, encode the variance of prior box in the loc loss target instead of
  568. // in bbox.
  569. optional bool encode_variance_in_target = 16 [default = false];
  570. // If true, map all object classes to agnostic class. It is useful for learning
  571. // objectness detector.
  572. optional bool map_object_to_agnostic = 17 [default = false];
  573. // If true, ignore cross boundary bbox during matching.
  574. // Cross boundary bbox is a bbox who is outside of the image region.
  575. optional bool ignore_cross_boundary_bbox = 18 [default = false];
  576. // If true, only backpropagate on corners which are inside of the image
  577. // region when encode_type is CORNER or CORNER_SIZE.
  578. optional bool bp_inside = 19 [default = false];
  579. // Mining type during training.
  580. // NONE : use all negatives.
  581. // MAX_NEGATIVE : select negatives based on the score.
  582. // HARD_EXAMPLE : select hard examples based on "Training Region-based Object Detectors with Online Hard Example Mining", Shrivastava et.al.
  583. enum MiningType {
  584. NONE = 0;
  585. MAX_NEGATIVE = 1;
  586. HARD_EXAMPLE = 2;
  587. }
  588. optional MiningType mining_type = 20 [default = MAX_NEGATIVE];
  589. // Parameters used for non maximum suppression durig hard example mining.
  590. optional NonMaximumSuppressionParameter nms_param = 21;
  591. optional int32 sample_size = 22 [default = 64];
  592. optional bool use_prior_for_nms = 23 [default = false];
  593. }
  594. message PermuteParameter {
  595. // The new orders of the axes of data. Notice it should be with
  596. // in the same range as the input data, and it starts from 0.
  597. // Do not provide repeated order.
  598. repeated uint32 order = 1;
  599. }
  600. // Message that stores parameters used by NormalizeBBoxLayer
  601. message NormalizeBBoxParameter {
  602. optional bool across_spatial = 1 [default = true];
  603. // Initial value of scale. Default is 1.0 for all
  604. optional FillerParameter scale_filler = 2;
  605. // Whether or not scale parameters are shared across channels.
  606. optional bool channel_shared = 3 [default = true];
  607. // Epsilon for not dividing by zero while normalizing variance
  608. optional float eps = 4 [default = 1e-10];
  609. }
  610. message PriorBoxParameter {
  611. // Encode/decode type.
  612. enum CodeType {
  613. CORNER = 1;
  614. CENTER_SIZE = 2;
  615. CORNER_SIZE = 3;
  616. }
  617. // Minimum box size (in pixels). Required!
  618. repeated float min_size = 1;
  619. // Maximum box size (in pixels). Required!
  620. repeated float max_size = 2;
  621. // Various of aspect ratios. Duplicate ratios will be ignored.
  622. // If none is provided, we use default ratio 1.
  623. repeated float aspect_ratio = 3;
  624. // If true, will flip each aspect ratio.
  625. // For example, if there is aspect ratio "r",
  626. // we will generate aspect ratio "1.0/r" as well.
  627. optional bool flip = 4 [default = true];
  628. // If true, will clip the prior so that it is within [0, 1]
  629. optional bool clip = 5 [default = false];
  630. // Variance for adjusting the prior bboxes.
  631. repeated float variance = 6;
  632. // By default, we calculate img_height, img_width, step_x, step_y based on
  633. // bottom[0] (feat) and bottom[1] (img). Unless these values are explicitely
  634. // provided.
  635. // Explicitly provide the img_size.
  636. optional uint32 img_size = 7;
  637. // Either img_size or img_h/img_w should be specified; not both.
  638. optional uint32 img_h = 8;
  639. optional uint32 img_w = 9;
  640. // Explicitly provide the step size.
  641. optional float step = 10;
  642. // Either step or step_h/step_w should be specified; not both.
  643. optional float step_h = 11;
  644. optional float step_w = 12;
  645. // Offset to the top left corner of each cell.
  646. optional float offset = 13 [default = 0.5];
  647. }
  648. // Message that store parameters used by DetectionOutputLayer
  649. message DetectionOutputParameter {
  650. // Number of classes to be predicted. Required!
  651. optional uint32 num_classes = 1;
  652. // If true, bounding box are shared among different classes.
  653. optional bool share_location = 2 [default = true];
  654. // Background label id. If there is no background class,
  655. // set it as -1.
  656. optional int32 background_label_id = 3 [default = 0];
  657. // Parameters used for non maximum suppression.
  658. optional NonMaximumSuppressionParameter nms_param = 4;
  659. // Parameters used for saving detection results.
  660. optional SaveOutputParameter save_output_param = 5;
  661. // Type of coding method for bbox.
  662. optional PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
  663. // If true, variance is encoded in target; otherwise we need to adjust the
  664. // predicted offset accordingly.
  665. optional bool variance_encoded_in_target = 8 [default = false];
  666. // Number of total bboxes to be kept per image after nms step.
  667. // -1 means keeping all bboxes after nms step.
  668. optional int32 keep_top_k = 7 [default = -1];
  669. // Only consider detections whose confidences are larger than a threshold.
  670. // If not provided, consider all boxes.
  671. optional float confidence_threshold = 9;
  672. // If true, visualize the detection results.
  673. optional bool visualize = 10 [default = false];
  674. // The threshold used to visualize the detection results.
  675. optional float visualize_threshold = 11;
  676. // If provided, save outputs to video file.
  677. optional string save_file = 12;
  678. // Parameters used for non maximum suppression.
  679. // Threshold to be used in nms.
  680. optional float nms_threshold = 32768 [default = 0.3];
  681. // Maximum number of results to be kept.
  682. optional int32 top_k = 32769;
  683. }
  684. // Message that store parameters used by DetectionEvaluateLayer
  685. message DetectionEvaluateParameter {
  686. // Number of classes that are actually predicted. Required!
  687. optional uint32 num_classes = 1;
  688. // Label id for background class. Needed for sanity check so that
  689. // background class is neither in the ground truth nor the detections.
  690. optional uint32 background_label_id = 2 [default = 0];
  691. // Threshold for deciding true/false positive.
  692. optional float overlap_threshold = 3 [default = 0.5];
  693. // If true, also consider difficult ground truth for evaluation.
  694. optional bool evaluate_difficult_gt = 4 [default = true];
  695. // A file which contains a list of names and sizes with same order
  696. // of the input DB. The file is in the following format:
  697. // name height width
  698. // ...
  699. // If provided, we will scale the prediction and ground truth NormalizedBBox
  700. // for evaluation.
  701. optional string name_size_file = 5;
  702. // The resize parameter used in converting NormalizedBBox to original image.
  703. optional ResizeParameter resize_param = 6;
  704. }
  705. // Message that stores parameters used by NormalizeLayer
  706. message NormalizeParameter {
  707. optional bool across_spatial = 1 [default = true];
  708. // Initial value of scale. Default is 1.0 for all
  709. optional FillerParameter scale_filler = 2;
  710. // Whether or not scale parameters are shared across channels.
  711. optional bool channel_shared = 3 [default = true];
  712. // Epsilon for not dividing by zero while normalizing variance
  713. optional float eps = 4 [default = 1e-10];
  714. }
  715. message VideoDataParameter{
  716. enum VideoType {
  717. WEBCAM = 0;
  718. VIDEO = 1;
  719. }
  720. optional VideoType video_type = 1 [default = WEBCAM];
  721. optional int32 device_id = 2 [default = 0];
  722. optional string video_file = 3;
  723. // Number of frames to be skipped before processing a frame.
  724. optional uint32 skip_frames = 4 [default = 0];
  725. }
  726. message SplitParameter {
  727. enum Engine {
  728. DEFAULT = 0;
  729. CAFFE = 1;
  730. MKL2017 = 3;
  731. MKLDNN = 4;
  732. }
  733. optional Engine engine = 1 [default = DEFAULT];
  734. }
  735. message RegionLossParameter{
  736. //Yolo 9000
  737. optional uint32 side = 1 [default = 13];
  738. optional uint32 num_class = 2 [default = 20];
  739. optional uint32 bias_match = 3 [default = 1];
  740. optional uint32 coords = 4 [default = 4];
  741. optional uint32 num = 5 [default = 5];
  742. optional uint32 softmax = 6 [default = 1];
  743. optional float jitter = 7 [default = 0.2];
  744. optional uint32 rescore = 8 [default = 1];
  745. optional float object_scale = 9 [default = 1.0];
  746. optional float class_scale = 10 [default = 1.0];
  747. optional float noobject_scale = 11 [default = 0.5];
  748. optional float coord_scale = 12 [default = 5.0];
  749. optional uint32 absolute = 13 [default = 1];
  750. optional float thresh = 14 [default = 0.2];
  751. optional uint32 random = 15 [default = 1];
  752. repeated float biases = 16;
  753. optional string softmax_tree = 17;
  754. optional string class_map = 18;
  755. }
  756. message EvalDetectionParameter {
  757. enum ScoreType {
  758. OBJ = 0;
  759. PROB = 1;
  760. MULTIPLY = 2;
  761. }
  762. // Yolo detection evaluation layer
  763. optional uint32 side = 1 [default = 7];
  764. optional uint32 num_class = 2 [default = 20];
  765. optional uint32 num_object = 3 [default = 2];
  766. optional float threshold = 4 [default = 0.5];
  767. optional bool sqrt = 5 [default = true];
  768. optional bool constriant = 6 [default = true];
  769. optional ScoreType score_type = 7 [default = MULTIPLY];
  770. optional float nms = 8 [default = -1];
  771. repeated float biases = 9;
  772. }
  773. message ShuffleChannelParameter {
  774. optional uint32 group = 1 [default = 1]; // The number of group
  775. }
  776. message CoeffScheduleParameter {
  777. optional float half_life = 1 [default = 1];
  778. optional float initial_coeff = 2 [default = 1];
  779. optional float final_coeff = 3 [default = 1];
  780. }
  781. // Message describing distribution of augmentation parameters
  782. message AugmentationParameter {
  783. optional uint32 crop_width = 33 [default = 0];
  784. optional uint32 crop_height = 34 [default = 0];
  785. optional string write_augmented = 2 [default = ""];
  786. optional float max_multiplier = 3 [default = 255.];
  787. optional bool augment_during_test = 4 [default = false];
  788. optional uint32 recompute_mean = 5 [default = 0]; // number of iterations to recompute mean (0 - do not recompute)
  789. optional string write_mean = 6 [default = ""];
  790. optional bool mean_per_pixel = 7 [default = true]; // if the mean is computed for each pixel or for the whole channel
  791. repeated float mean = 18; // Eddy: Per pixel RGB mean to subtract
  792. optional string mode = 8 [default = "add"]; // can be "add" or "replace" or "regenerate"
  793. optional uint32 bottomwidth = 80 [default = 0];
  794. optional uint32 bottomheight = 81 [default = 0];
  795. optional uint32 num = 82 [default = 0];
  796. repeated float chromatic_eigvec = 83;
  797. // Spatial
  798. optional RandomGeneratorParameter mirror = 10;
  799. optional RandomGeneratorParameter translate = 11 ;
  800. optional RandomGeneratorParameter rotate = 12 ;
  801. optional RandomGeneratorParameter zoom = 13 ;
  802. optional RandomGeneratorParameter squeeze = 14 ;
  803. optional RandomGeneratorParameter translate_x = 15 ;
  804. optional RandomGeneratorParameter translate_y = 16 ;
  805. // Chromatic
  806. optional RandomGeneratorParameter gamma = 35 ;
  807. optional RandomGeneratorParameter brightness = 36 ;
  808. optional RandomGeneratorParameter contrast = 37 ;
  809. optional RandomGeneratorParameter color = 38 ;
  810. // Chromatic-Eigen
  811. optional RandomGeneratorParameter lmult_pow = 20 ;
  812. optional RandomGeneratorParameter lmult_mult = 21 ;
  813. optional RandomGeneratorParameter lmult_add = 22 ;
  814. optional RandomGeneratorParameter sat_pow = 23 ;
  815. optional RandomGeneratorParameter sat_mult = 24 ;
  816. optional RandomGeneratorParameter sat_add = 25 ;
  817. optional RandomGeneratorParameter col_pow = 26 ;
  818. optional RandomGeneratorParameter col_mult = 27 ;
  819. optional RandomGeneratorParameter col_add = 28 ;
  820. optional RandomGeneratorParameter ladd_pow = 29 ;
  821. optional RandomGeneratorParameter ladd_mult = 30 ;
  822. optional RandomGeneratorParameter ladd_add = 31 ;
  823. optional RandomGeneratorParameter col_rotate = 32 ;
  824. // Effect
  825. optional RandomGeneratorParameter fog_amount = 100 ;
  826. optional RandomGeneratorParameter fog_size = 101 ;
  827. optional RandomGeneratorParameter motion_blur_angle = 102 ;
  828. optional RandomGeneratorParameter motion_blur_size = 103 ;
  829. optional RandomGeneratorParameter shadow_angle = 104 ;
  830. optional RandomGeneratorParameter shadow_distance = 105 ;
  831. optional RandomGeneratorParameter shadow_strength = 106 ;
  832. optional RandomGeneratorParameter noise = 107 ;
  833. }
  834. message BlackAugmentationParameter {
  835. optional RandomGeneratorParameter black = 10;
  836. optional RandomGeneratorParameter border = 11;
  837. }
  838. // Message that stores parameters used by CorrelationLayer
  839. message CorrelationParameter {
  840. optional uint32 pad = 2 [default = 0]; // The padding size (equal in Y, X)
  841. optional uint32 kernel_size = 3; // The kernel size (square)
  842. optional uint32 max_displacement = 4; // The maximum displacement (square)
  843. optional uint32 stride_1 = 5 [default = 1]; // The stride in blob 1 (equal in Y, X)
  844. optional uint32 stride_2 = 6 [default = 1]; // The stride in blob 2 (equal in Y, X)
  845. // For Correlation1D:
  846. optional int32 single_direction = 8 [default = 0]; // Correlate only to the left (-1) or right (1)
  847. optional bool do_abs = 7 [default = false]; // Use absolute value of result
  848. enum CorrelationType {
  849. MULTIPLY = 0;
  850. SUBTRACT = 1;
  851. }
  852. optional CorrelationType correlation_type = 15 [default = MULTIPLY]; // Multiplicative is normal correlation
  853. }
  854. // Message that stores parameters used by L1LossLayer
  855. message L1LossParameter {
  856. optional bool l2_per_location = 1 [default = false];
  857. optional bool l2_prescale_by_channels = 2 [default = false]; // Old style
  858. optional bool normalize_by_num_entries = 3 [default = false]; // if we want to normalize not by batch size, but by the number of non-NaN entries
  859. optional float epsilon = 4 [default = 1e-2]; // constant for smoothing near zero
  860. optional float plateau = 3001 [default = 0]; // L1 Errors smaller than plateau-value will result in zero loss and no gradient
  861. }
  862. message ReaderParameter {
  863. required string file = 1;
  864. optional uint32 num = 2 [default=1];
  865. }
  866. message WriterParameter {
  867. optional string file = 1 [default=""];
  868. optional string folder = 2 [default=""];
  869. optional string prefix = 3 [default=""];
  870. optional string suffix = 4 [default=""];
  871. optional bool normalize = 5 [default=false];
  872. optional float scale = 6 [default=1];
  873. }
  874. message MeanParameter {
  875. enum MeanOperation {
  876. ADD = 1;
  877. SUBTRACT = 4;
  878. }
  879. required MeanOperation operation = 1;
  880. optional string file = 2;
  881. repeated float value = 3;
  882. optional float mean_scale = 4 [default = 1];
  883. optional float input_scale = 5 [default = 1];
  884. optional float output_scale = 6 [default = 1];
  885. }
  886. message ResampleParameter {
  887. enum ResampleType {
  888. NEAREST = 1;
  889. LINEAR = 2;
  890. CUBIC = 3;
  891. AREA = 4;
  892. };
  893. optional bool antialias = 4 [ default = true ];
  894. optional uint32 width = 1;
  895. optional uint32 height = 2;
  896. optional ResampleType type = 3 [ default = LINEAR ];
  897. optional float factor = 5 [ default = 1.0 ];
  898. }
  899. message DownsampleParameter {
  900. optional uint32 top_height = 1 [default = 0]; // The output height
  901. optional uint32 top_width = 2 [default = 0]; // The output width
  902. }
  903. // Message that stores parameters used by LpqLossLayer
  904. message LpqLossParameter {
  905. /**
  906. * Legacy parameter; now applies to p-PowerLayer
  907. */
  908. optional bool l2_prescale_by_channels = 4016 [default = false];
  909. // if we want to normalize not by batch size, but by the number of non-NaN entries
  910. optional bool normalize_by_num_entries = 4017 [default = false];
  911. /**
  912. * "Shift" for p-PowerLayer. Since the Lpq layer uses this parameter
  913. * to avoid singularities around 0, and p is usually >=1, this parameter
  914. * is normally 0.
  915. */
  916. optional float p_epsilon = 4013 [default = 0];
  917. /**
  918. * "Shift" for q-PowerLayer. Since the Lpq layer uses this parameter
  919. * to avoid singularities around 0, and q is usually <=1, this parameter
  920. * is usually relevant and positive.
  921. */
  922. optional float q_epsilon = 4014 [default = 1e-2];
  923. /****************************
  924. * If one of each of the following is given, p/q are constant and the entry
  925. * in "pq_episode_starts_at_iter" must be 0 (else the first entry must be 0).
  926. *
  927. * If multiple values are given (the number of values must be the same for
  928. * each parameter), then p/q will jump at each iteration number given in
  929. * "pq_episode_starts_at_iter".
  930. ****************************
  931. * Example: pq_episode_starts_at_iter = {0, 1000, 500000}
  932. * p = {1.0, 2.0, 2.0}
  933. * q = {1.0, 1.0, 2.0}
  934. *
  935. * With these values, p/q will be 1.0/1.0 from iteration 0 to 1000, then
  936. * 2.0/1.0 until iteration 500000, and 2.0/2.0 afterwards.
  937. ****************************/
  938. repeated uint32 pq_episode_starts_at_iter = 4010;
  939. repeated float p = 4011;
  940. repeated float q = 4012;
  941. }
  942. message FlowWarpParameter {
  943. enum FillParameter {
  944. ZERO = 1;
  945. NOT_A_NUMBER = 2;
  946. }
  947. optional FillParameter fill_value = 1 [ default = ZERO ];
  948. }
  949. message AccumParameter {
  950. optional uint32 top_height = 1 [default = 0]; // The output height
  951. optional uint32 top_width = 2 [default = 0]; // The output width
  952. optional uint32 size_divisible_by = 3 [default = 0]; // Upscales to the minimal size divisible by the given number
  953. optional bool have_reference = 4 [ default = false ];
  954. }
  955. message YoloV2LossParameter {
  956. repeated float anchors = 1;
  957. optional int32 side = 2;
  958. optional int32 num_classes = 3;
  959. optional int32 num_object = 4;
  960. optional float box_scale = 5 [default = .5];
  961. optional float class_scale = 6 [default = .5];
  962. optional float noobject_scale = 7 [default = .5];
  963. optional float object_scale = 8 [default = .5];
  964. optional bool rescore = 9 [default = true];
  965. optional bool constraint = 10 [default = true];
  966. optional float thresh = 11 [default = 0.7];
  967. }
  968. message YoloV3LossParameter {
  969. repeated int32 anchors = 1;
  970. repeated int32 mask = 2;
  971. optional int32 side = 3;
  972. optional int32 num_classes = 4;
  973. optional int32 num_object = 5;
  974. optional int32 total_object = 6;
  975. optional float ignore_thresh = 7 [default = 0.7];
  976. optional float truth_thresh = 8 [default = 1.0];
  977. optional int32 net_w = 9;
  978. optional int32 net_h = 10;
  979. }
  980. // Message used by AugmentationParameter for describing how to generate augmentation parameters
  981. message RandomGeneratorParameter {
  982. optional string rand_type = 1 [default = "uniform" ]; // can be uniform, gaussian, bernoulli
  983. optional bool exp = 2 [default = false ]; // after generating the random number, exponentiate it or not
  984. optional float mean = 4 [default = 0. ]; // mean of the random variable
  985. optional float spread = 5 [default = 0. ]; // half of interval length for uniform; standard deviation for gaussian
  986. optional float prob = 6 [default = 1.];
  987. optional bool apply_schedule = 7 [default = true];
  988. optional bool discretize = 8 [default = false]; //Discretize (Round) value from rng to INT
  989. optional float multiplier = 9 [default = 1.]; //Final random value will be multiplied by this. (Useful for discrete distributions)
  990. }
  991. message RingPadParameter {
  992. optional int32 axis = 1 [default = 1];
  993. optional int32 pad = 2 [default = 1];
  994. }
  995. // Message that stores parameters used by BoxOutputLayer
  996. message BoxOutputParameter {
  997. // Set the cutoff threshold
  998. optional float fg_thr = 1 [default = 0];
  999. optional float iou_thr = 2 [default = 0.5];
  1000. // Specifiy the number of coordinates
  1001. optional string nms_type = 3 [default = "IOU"];
  1002. repeated uint32 field_h = 4;
  1003. repeated uint32 field_w = 5;
  1004. repeated uint32 downsample_rate = 6;
  1005. optional float field_whr = 7 [default = 2];
  1006. optional float field_xyr = 8 [default = 2];
  1007. optional uint32 max_nms_num = 9 [default = 0];
  1008. optional uint32 max_post_nms_num = 10 [default = 0];
  1009. optional float min_size = 11 [default = 15];
  1010. optional uint32 num_param_set = 12 [default = 1];
  1011. optional bool ringpad = 13 [default = false];
  1012. }
  1013. message YoloDetectionOutputParameter {
  1014. // Yolo detection output layer
  1015. optional uint32 side = 1 [default = 13];
  1016. optional uint32 num_classes = 2 [default = 20];
  1017. optional uint32 num_box = 3 [default = 5];
  1018. optional uint32 coords = 4 [default = 4];
  1019. optional float confidence_threshold = 5 [default = 0.01];
  1020. optional float nms_threshold = 6 [default = 0.45];
  1021. repeated float biases = 7;
  1022. optional string label_map_file = 8;
  1023. }
  1024. message Yolov3DetectionOutputParameter {
  1025. // Yolo detection output layer
  1026. optional uint32 num_classes = 1 [default = 20];
  1027. optional uint32 num_box = 2 [default = 3];
  1028. optional float confidence_threshold = 3 [default = 0.01];
  1029. optional float nms_threshold = 4 [default = 0.45];
  1030. repeated float biases = 5;
  1031. repeated uint32 anchors_scale = 6 ;
  1032. optional uint32 mask_group_num = 7 [default = 2];
  1033. repeated uint32 mask = 8;
  1034. }
  1035. `);
  1036. fs.writeFileSync(file, data, 'utf-8');