args.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include <gflags/gflags.h>
  16. // common args
  17. DECLARE_bool(use_gpu);
  18. DECLARE_bool(use_tensorrt);
  19. DECLARE_int32(gpu_id);
  20. DECLARE_int32(gpu_mem);
  21. DECLARE_int32(cpu_threads);
  22. DECLARE_bool(enable_mkldnn);
  23. DECLARE_string(precision);
  24. DECLARE_bool(benchmark);
  25. DECLARE_string(output);
  26. DECLARE_string(image_dir);
  27. DECLARE_string(type);
  28. // detection related
  29. DECLARE_string(det_model_dir);
  30. DECLARE_string(limit_type);
  31. DECLARE_int32(limit_side_len);
  32. DECLARE_double(det_db_thresh);
  33. DECLARE_double(det_db_box_thresh);
  34. DECLARE_double(det_db_unclip_ratio);
  35. DECLARE_bool(use_dilation);
  36. DECLARE_string(det_db_score_mode);
  37. DECLARE_bool(visualize);
  38. // classification related
  39. DECLARE_bool(use_angle_cls);
  40. DECLARE_string(cls_model_dir);
  41. DECLARE_double(cls_thresh);
  42. DECLARE_int32(cls_batch_num);
  43. // recognition related
  44. DECLARE_string(rec_model_dir);
  45. DECLARE_int32(rec_batch_num);
  46. DECLARE_string(rec_char_dict_path);
  47. DECLARE_int32(rec_img_h);
  48. DECLARE_int32(rec_img_w);
  49. // layout model related
  50. DECLARE_string(layout_model_dir);
  51. DECLARE_string(layout_dict_path);
  52. DECLARE_double(layout_score_threshold);
  53. DECLARE_double(layout_nms_threshold);
  54. // structure model related
  55. DECLARE_string(table_model_dir);
  56. DECLARE_int32(table_max_len);
  57. DECLARE_int32(table_batch_num);
  58. DECLARE_string(table_char_dict_path);
  59. DECLARE_bool(merge_no_span_structure);
  60. // forward related
  61. DECLARE_bool(det);
  62. DECLARE_bool(rec);
  63. DECLARE_bool(cls);
  64. DECLARE_bool(table);
  65. DECLARE_bool(layout);