Commit f3ceebc4 authored by xu rui's avatar xu rui
Browse files

fix: read_api list files

parent 3cd51d49
...@@ -58,7 +58,7 @@ def read_local_pdfs(path: str) -> list[PymuDocDataset]: ...@@ -58,7 +58,7 @@ def read_local_pdfs(path: str) -> list[PymuDocDataset]:
list[PymuDocDataset]: each pdf file will converted to a PymuDocDataset list[PymuDocDataset]: each pdf file will converted to a PymuDocDataset
""" """
if os.path.isdir(path): if os.path.isdir(path):
reader = FileBasedDataReader(path) reader = FileBasedDataReader()
ret = [] ret = []
for root, _, files in os.walk(path): for root, _, files in os.walk(path):
for file in files: for file in files:
...@@ -85,7 +85,7 @@ def read_local_images(path: str, suffixes: list[str]=[]) -> list[ImageDataset]: ...@@ -85,7 +85,7 @@ def read_local_images(path: str, suffixes: list[str]=[]) -> list[ImageDataset]:
if os.path.isdir(path): if os.path.isdir(path):
imgs_bits = [] imgs_bits = []
s_suffixes = set(suffixes) s_suffixes = set(suffixes)
reader = FileBasedDataReader(path) reader = FileBasedDataReader()
for root, _, files in os.walk(path): for root, _, files in os.walk(path):
for file in files: for file in files:
suffix = file.split('.') suffix = file.split('.')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment