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
902dcd2c
Commit
902dcd2c
authored
Jan 14, 2025
by
myhloli
Browse files
refactor(BatchAnalyze): comment out image rotation logic in doclayout_yolo
parent
c20e9a1e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
magic_pdf/model/batch_analyze.py
magic_pdf/model/batch_analyze.py
+10
-10
No files found.
magic_pdf/model/batch_analyze.py
View file @
902dcd2c
...
...
@@ -44,15 +44,15 @@ class BatchAnalyze:
modified_images
=
[]
for
image_index
,
image
in
enumerate
(
images
):
pil_img
=
Image
.
fromarray
(
image
)
width
,
height
=
pil_img
.
size
if
height
>
width
:
input_res
=
{
'poly'
:
[
0
,
0
,
width
,
0
,
width
,
height
,
0
,
height
]}
new_image
,
useful_list
=
crop_img
(
input_res
,
pil_img
,
crop_paste_x
=
width
//
2
,
crop_paste_y
=
0
)
layout_images
.
append
(
new_image
)
modified_images
.
append
([
image_index
,
useful_list
])
else
:
#
width, height = pil_img.size
#
if height > width:
#
input_res = {'poly': [0, 0, width, 0, width, height, 0, height]}
#
new_image, useful_list = crop_img(
#
input_res, pil_img, crop_paste_x=width // 2, crop_paste_y=0
#
)
#
layout_images.append(new_image)
#
modified_images.append([image_index, useful_list])
#
else:
layout_images
.
append
(
pil_img
)
images_layout_res
+=
self
.
model
.
layout_model
.
batch_predict
(
...
...
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