Skip to content

Commit

Permalink
perf: add crop resize from aidata to download crop pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
danellecline committed Dec 22, 2024
1 parent 9cb9a5c commit 188044e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions aipipeline/prediction/download_crop_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# aipipeline, Apache-2.0 license
# Filename: projects/predictions/download-crop-pipeline.py
# Filename: aipipeline/prediction/download-crop-pipeline.py
# Description: Download dataset of images and prepare them running vss pipelines
import glob
from datetime import datetime
Expand Down Expand Up @@ -86,19 +86,18 @@ def run_pipeline(argv=None):
if not args.skip_clean:
clean(download_path.as_posix())

if args.download_args:
config_dict["data"]["download_args"] = args.download_args.split(" ")
if args.download_dir:
config_dict["data"]["processed_path"] = args.download_dir

processed_dir = Path(config_dict["data"]["processed_path"])
download_args = config_dict["data"]["download_args"]
download_args.extend(["--crop-roi", "--resize", "224"])
config_dict["data"]["download_args"] = download_args

with beam.Pipeline(options=options) as p:
(
p
| "Start download" >> beam.Create([labels])
| "Download labeled data" >> beam.Map(download, conf_files=conf_files, config_dict=config_dict)
| "Crop ROI" >> beam.Map(crop_rois_voc, config_dict=config_dict, processed_dir=processed_dir)
| "Log results" >> beam.Map(logger.info)
)

Expand Down

0 comments on commit 188044e

Please sign in to comment.