Skip to content

Commit

Permalink
fix: correct args to download_crop_pipeline.py
Browse files Browse the repository at this point in the history
  • Loading branch information
danellecline committed Nov 7, 2024
1 parent ac2559f commit c6a4fe7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aipipeline/prediction/download_crop_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,24 @@ def run_pipeline(argv=None):
parser = argparse.ArgumentParser(description="Download and crop unknown images.")
parser.add_argument("--config", required=True, help="Config file path")
parser.add_argument("--labels", required=True, help="Comma separated list of labels to download")
parser.add_argument("--download-args", required=False, default=[""], help="Additional arguments for download")
parser.add_argument("--download-args", required=False, help="Additional arguments for download")
parser.add_argument("--download-dir", required=True, help="Directory to download images")
parser.add_argument("--skip-clean", required=False, default=False,
help="Skip cleaning of previously downloaded data")
args, beam_args = parser.parse_known_args(argv)
options = PipelineOptions(beam_args)
conf_files, config_dict = setup_config(args.config, silent=True)
download_args = config_dict["data"]["download_args"]

if not os.path.exists(args.download_dir):
os.makedirs(args.download_dir)

# Override the config
config_dict["data"]["labels"] = args.labels
config_dict["data"]["download_args"] = args.download_args
if args.download_args:
config_dict["data"]["download_args"] = [args.download_args]

labels = args.labels.split(",")
download_args = config_dict["data"]["download_args"]

# Print the new config
logger.info("Configuration:")
Expand Down

0 comments on commit c6a4fe7

Please sign in to comment.