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
c968ce86
Commit
c968ce86
authored
Dec 18, 2024
by
icecraft
Browse files
fix: remove pipe_auto_method
parent
cd11ddcd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
32 deletions
+4
-32
magic_pdf/operators/__init__.py
magic_pdf/operators/__init__.py
+4
-32
No files found.
magic_pdf/operators/__init__.py
View file @
c968ce86
from
typing
import
Callable
from
abc
import
ABC
,
abstractmethod
from
abc
import
ABC
,
abstractmethod
from
typing
import
Callable
from
magic_pdf.data.data_reader_writer
import
DataWriter
from
magic_pdf.data.data_reader_writer
import
DataWriter
from
magic_pdf.data.dataset
import
Dataset
from
magic_pdf.data.dataset
import
Dataset
from
magic_pdf.operators.pipes
import
PipeResult
from
magic_pdf.operators.pipes
import
PipeResult
__use_inside_model__
=
True
__use_inside_model__
=
True
__model_mode__
=
"
full
"
__model_mode__
=
'
full
'
class
InferenceResultBase
(
ABC
):
class
InferenceResultBase
(
ABC
):
...
@@ -64,32 +62,6 @@ class InferenceResultBase(ABC):
...
@@ -64,32 +62,6 @@ class InferenceResultBase(ABC):
"""
"""
pass
pass
@
abstractmethod
def
pipe_auto_mode
(
self
,
imageWriter
:
DataWriter
,
start_page_id
=
0
,
end_page_id
=
None
,
debug_mode
=
False
,
lang
=
None
,
)
->
PipeResult
:
"""Post-proc the model inference result.
step1: classify the dataset type
step2: based the result of step1, using `pipe_txt_mode` or `pipe_ocr_mode`
Args:
imageWriter (DataWriter): the image writer handle
start_page_id (int, optional): Defaults to 0. Let user select some pages He/She want to process
end_page_id (int, optional): Defaults to the last page index of dataset. Let user select some pages He/She want to process
debug_mode (bool, optional): Defaults to False. will dump more log if enabled
lang (str, optional): Defaults to None.
Returns:
PipeResult: the result
"""
pass
@
abstractmethod
def
pipe_txt_mode
(
def
pipe_txt_mode
(
self
,
self
,
imageWriter
:
DataWriter
,
imageWriter
:
DataWriter
,
...
...
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