Skip to content
Snippets Groups Projects
Commit 641d6c3f authored by Martin's avatar Martin
Browse files

remove deprecated filtering by source.slug

parent 681f7ff5
No related branches found
No related tags found
1 merge request!17remove deprecated filtering by source.slug
Pipeline #74307 passed
......@@ -24,9 +24,6 @@ from kaldi_data_generator.image_utils import (
)
from kaldi_data_generator.utils import TranscriptionData, logger, write_file
# api_client = ArkindexClient(**options_from_env())
# api_client = None
SEED = 42
random.seed(SEED)
MANUAL = "manual"
......@@ -64,7 +61,6 @@ class HTRDataGenerator:
out_dir_base="/tmp/kaldi_data",
grayscale=True,
extraction=Extraction.boundingRect,
accepted_slugs=None,
accepted_classes=None,
filter_printed=False,
skip_vertical_lines=False,
......@@ -83,8 +79,6 @@ class HTRDataGenerator:
self.dataset_name = dataset_name
self.grayscale = grayscale
self.extraction_mode = extraction
self.accepted_slugs = accepted_slugs
self.should_filter_by_slug = bool(self.accepted_slugs)
self.accepted_classes = accepted_classes
self.should_filter_by_class = bool(self.accepted_classes)
self.accepted_worker_version_ids = accepted_worker_version_ids
......@@ -174,11 +168,6 @@ class HTRDataGenerator:
for res in self.api_client.paginate(
"ListTranscriptions", id=page_id, recursive=True
):
if (
self.should_filter_by_slug
and res["source"]["slug"] not in self.accepted_slugs
):
continue
if (
self.should_filter_by_worker
and res["worker_version_id"] not in self.accepted_worker_version_ids
......@@ -677,12 +666,6 @@ def create_parser():
help="skips vertical lines when downloading",
)
parser.add_argument(
"--accepted_slugs",
nargs="*",
help="List of accepted slugs for downloading transcriptions",
)
parser.add_argument(
"--accepted_classes",
nargs="*",
......@@ -744,7 +727,6 @@ def main():
out_dir_base=args.out_dir,
grayscale=args.grayscale,
extraction=args.extraction_mode,
accepted_slugs=args.accepted_slugs,
accepted_classes=args.accepted_classes,
filter_printed=args.filter_printed,
skip_vertical_lines=args.skip_vertical_lines,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment