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
zhougaofeng
magic_pdf
Commits
ceae1d62
Commit
ceae1d62
authored
Nov 13, 2024
by
zhougaofeng
Browse files
Update magic_model.py
parent
67bd7bf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
24 deletions
+1
-24
magic_pdf/model/magic_model.py
magic_pdf/model/magic_model.py
+1
-24
No files found.
magic_pdf/model/magic_model.py
View file @
ceae1d62
...
...
@@ -1050,27 +1050,4 @@ class MagicModel:
if
__name__
==
'__main__'
:
drw
=
DiskReaderWriter
(
r
'D:/project/20231108code-clean'
)
if
0
:
pdf_file_path
=
r
'linshixuqiu\19983-00.pdf'
model_file_path
=
r
'linshixuqiu\19983-00_new.json'
pdf_bytes
=
drw
.
read
(
pdf_file_path
,
AbsReaderWriter
.
MODE_BIN
)
model_json_txt
=
drw
.
read
(
model_file_path
,
AbsReaderWriter
.
MODE_TXT
)
model_list
=
json
.
loads
(
model_json_txt
)
write_path
=
r
'D:\project\20231108code-clean\linshixuqiu\19983-00'
img_bucket_path
=
'imgs'
img_writer
=
DiskReaderWriter
(
join_path
(
write_path
,
img_bucket_path
))
pdf_docs
=
fitz
.
open
(
'pdf'
,
pdf_bytes
)
magic_model
=
MagicModel
(
model_list
,
pdf_docs
)
if
1
:
model_list
=
json
.
loads
(
drw
.
read
(
'/opt/data/pdf/20240418/j.chroma.2009.03.042.json'
)
)
pdf_bytes
=
drw
.
read
(
'/opt/data/pdf/20240418/j.chroma.2009.03.042.pdf'
,
AbsReaderWriter
.
MODE_BIN
)
pdf_docs
=
fitz
.
open
(
'pdf'
,
pdf_bytes
)
magic_model
=
MagicModel
(
model_list
,
pdf_docs
)
for
i
in
range
(
7
):
print
(
magic_model
.
get_imgs
(
i
))
pass
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