Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
c3531d72
Commit
c3531d72
authored
Jun 10, 2025
by
myhloli
Browse files
refactor: update model paths and enhance RapidTableModel initialization
parent
83b965b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
mineru/model/table/rapid_table.py
mineru/model/table/rapid_table.py
+4
-4
mineru/resources/slanet_plus/slanet-plus.onnx
mineru/resources/slanet_plus/slanet-plus.onnx
+0
-0
mineru/utils/enum_class.py
mineru/utils/enum_class.py
+3
-2
No files found.
mineru/model/table/rapid_table.py
View file @
c3531d72
import
os
from
pathlib
import
Path
import
cv2
import
cv2
import
numpy
as
np
import
numpy
as
np
from
loguru
import
logger
from
loguru
import
logger
from
rapid_table
import
RapidTable
,
RapidTableInput
from
rapid_table
import
RapidTable
,
RapidTableInput
from
mineru.utils.enum_class
import
ModelPath
from
mineru.utils.models_download_utils
import
get_file_from_repos
class
RapidTableModel
(
object
):
class
RapidTableModel
(
object
):
def
__init__
(
self
,
ocr_engine
):
def
__init__
(
self
,
ocr_engine
):
root_dir
=
Path
(
__file__
).
absolute
().
parent
.
parent
.
parent
slanet_plus_model_path
=
get_file_from_repos
(
ModelPath
.
slanet_plus
)
slanet_plus_model_path
=
os
.
path
.
join
(
root_dir
,
'resources'
,
'slanet_plus'
,
'slanet-plus.onnx'
)
input_args
=
RapidTableInput
(
model_type
=
'slanet_plus'
,
model_path
=
slanet_plus_model_path
)
input_args
=
RapidTableInput
(
model_type
=
'slanet_plus'
,
model_path
=
slanet_plus_model_path
)
self
.
table_model
=
RapidTable
(
input_args
)
self
.
table_model
=
RapidTable
(
input_args
)
self
.
ocr_engine
=
ocr_engine
self
.
ocr_engine
=
ocr_engine
...
...
mineru/resources/slanet_plus/slanet-plus.onnx
deleted
100644 → 0
View file @
83b965b7
File deleted
mineru/utils/enum_class.py
View file @
c3531d72
...
@@ -46,6 +46,8 @@ class MakeMode:
...
@@ -46,6 +46,8 @@ class MakeMode:
class
ModelPath
:
class
ModelPath
:
vlm_root_hf
=
"opendatalab/MinerU2.0-2505-0.9B"
vlm_root_modelscope
=
"OpenDataLab/MinerU2.0-2505-0.9B"
pipeline_root_modelscope
=
"OpenDataLab/PDF-Extract-Kit-1.0"
pipeline_root_modelscope
=
"OpenDataLab/PDF-Extract-Kit-1.0"
pipeline_root_hf
=
"opendatalab/PDF-Extract-Kit-1.0"
pipeline_root_hf
=
"opendatalab/PDF-Extract-Kit-1.0"
doclayout_yolo
=
"models/Layout/YOLO/doclayout_yolo_docstructbench_imgsz1280_2501.pt"
doclayout_yolo
=
"models/Layout/YOLO/doclayout_yolo_docstructbench_imgsz1280_2501.pt"
...
@@ -53,8 +55,7 @@ class ModelPath:
...
@@ -53,8 +55,7 @@ class ModelPath:
unimernet_small
=
"models/MFR/unimernet_hf_small_2503"
unimernet_small
=
"models/MFR/unimernet_hf_small_2503"
pytorch_paddle
=
"models/OCR/paddleocr_torch"
pytorch_paddle
=
"models/OCR/paddleocr_torch"
layout_reader
=
"models/ReadingOrder/layout_reader"
layout_reader
=
"models/ReadingOrder/layout_reader"
vlm_root_hf
=
"opendatalab/MinerU2.0-2505-0.9B"
slanet_plus
=
"models/TabRec/SlanetPlus/slanet-plus.onnx"
vlm_root_modelscope
=
"OpenDataLab/MinerU2.0-2505-0.9B"
class
SplitFlag
:
class
SplitFlag
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment