config.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. Config
  2. =========
  3. File **magic-pdf.json** is typically located in the **${HOME}** directory under a Linux system or in the **C:\Users\{username}** directory under a Windows system.
  4. .. admonition:: Tip
  5. :class: tip
  6. You can override the default location of config file via the following command:
  7. export MINERU_TOOLS_CONFIG_JSON=new_magic_pdf.json
  8. magic-pdf.json
  9. ----------------
  10. .. code:: json
  11. {
  12. "bucket_info":{
  13. "bucket-name-1":["ak", "sk", "endpoint"],
  14. "bucket-name-2":["ak", "sk", "endpoint"]
  15. },
  16. "models-dir":"/tmp/models",
  17. "layoutreader-model-dir":"/tmp/layoutreader",
  18. "device-mode":"cpu",
  19. "layout-config": {
  20. "model": "doclayout_yolo"
  21. },
  22. "formula-config": {
  23. "mfd_model": "yolo_v8_mfd",
  24. "mfr_model": "unimernet_small",
  25. "enable": true
  26. },
  27. "table-config": {
  28. "model": "rapid_table",
  29. "enable": true,
  30. "max_time": 400
  31. },
  32. "config_version": "1.0.0"
  33. }
  34. bucket_info
  35. ^^^^^^^^^^^^^^
  36. Store the access_key, secret_key and endpoint of AWS S3 Compatible storage config
  37. Example:
  38. .. code:: text
  39. {
  40. "image_bucket":[{access_key}, {secret_key}, {endpoint}],
  41. "video_bucket":[{access_key}, {secret_key}, {endpoint}]
  42. }
  43. models-dir
  44. ^^^^^^^^^^^^
  45. Store the models download from **huggingface** or **modelshop**. You do not need to modify this field if you download the model using the scripts shipped with **MinerU**
  46. layoutreader-model-dir
  47. ^^^^^^^^^^^^^^^^^^^^^^^
  48. Store the models download from **huggingface** or **modelshop**. You do not need to modify this field if you download the model using the scripts shipped with **MinerU**
  49. devide-mode
  50. ^^^^^^^^^^^^^^
  51. This field have two options, **cpu** or **cuda**.
  52. **cpu**: inference via cpu
  53. **cuda**: using cuda to accelerate inference
  54. layout-config
  55. ^^^^^^^^^^^^^^^
  56. .. code:: json
  57. {
  58. "model": "doclayout_yolo"
  59. }
  60. layout model can not be disabled now.
  61. formula-config
  62. ^^^^^^^^^^^^^^^^
  63. .. code:: json
  64. {
  65. "mfd_model": "yolo_v8_mfd",
  66. "mfr_model": "unimernet_small",
  67. "enable": true
  68. }
  69. mfd_model
  70. """"""""""
  71. Specify the formula detection model, options are ['yolo_v8_mfd']
  72. mfr_model
  73. """"""""""
  74. Specify the formula recognition model, options are ['unimernet_small']
  75. Check `UniMERNet <https://github.com/opendatalab/UniMERNet>`_ for more details
  76. enable
  77. """"""""
  78. on-off flag, options are [true, false]. **true** means enable formula inference, **false** means disable formula inference
  79. table-config
  80. ^^^^^^^^^^^^^^^^
  81. .. code:: json
  82. {
  83. "model": "rapid_table",
  84. "enable": true,
  85. "max_time": 400
  86. }
  87. model
  88. """"""""
  89. Specify the table inference model, options are ['rapid_table']
  90. max_time
  91. """""""""
  92. Since table recognition is a time-consuming process, we set a timeout period. If the process exceeds this time, the table recognition will be terminated.
  93. enable
  94. """""""
  95. on-off flag, options are [true, false]. **true** means enable table inference, **false** means disable table inference
  96. config_version
  97. ^^^^^^^^^^^^^^^^
  98. The version of config schema.
  99. .. admonition:: Tip
  100. :class: tip
  101. Check `Config Schema <https://github.com/opendatalab/MinerU/blob/master/magic-pdf.template.json>`_ for the latest details