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
e4074828
Unverified
Commit
e4074828
authored
Mar 20, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Mar 20, 2025
Browse files
Merge pull request #1957 from myhloli/dev
refactor(magic_pdf): remove unnecessary half() calls for CPU devices
parents
5a3283c8
27281c92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
4 deletions
+0
-4
magic_pdf/model/sub_modules/layout/doclayout_yolo/DocLayoutYOLO.py
.../model/sub_modules/layout/doclayout_yolo/DocLayoutYOLO.py
+0
-2
magic_pdf/model/sub_modules/mfd/yolov8/YOLOv8.py
magic_pdf/model/sub_modules/mfd/yolov8/YOLOv8.py
+0
-2
No files found.
magic_pdf/model/sub_modules/layout/doclayout_yolo/DocLayoutYOLO.py
View file @
e4074828
...
...
@@ -4,8 +4,6 @@ from doclayout_yolo import YOLOv10
class
DocLayoutYOLOModel
(
object
):
def
__init__
(
self
,
weight
,
device
):
self
.
model
=
YOLOv10
(
weight
)
if
not
device
.
startswith
(
"cpu"
):
self
.
model
.
half
()
self
.
device
=
device
def
predict
(
self
,
image
):
...
...
magic_pdf/model/sub_modules/mfd/yolov8/YOLOv8.py
View file @
e4074828
...
...
@@ -4,8 +4,6 @@ from ultralytics import YOLO
class
YOLOv8MFDModel
(
object
):
def
__init__
(
self
,
weight
,
device
=
"cpu"
):
self
.
mfd_model
=
YOLO
(
weight
)
if
not
device
.
startswith
(
"cpu"
):
self
.
mfd_model
.
half
()
self
.
device
=
device
def
predict
(
self
,
image
):
...
...
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