Skip to content

Commit

Permalink
Add output dir as argutment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvmt committed Dec 2, 2024
1 parent 48075cb commit 9dbe4e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/run_megadetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
parser = argparse.ArgumentParser(description="Run MegaDetector on a folder of images.")
parser.add_argument('image_folder', type=str, help="Path to the folder containing images.")
parser.add_argument('detector_filename', type=str, help="Path to the MegaDetector model file.")
parser.add_argument('output_dir', type=str, help="Directory of the MegaDetector output file.")
args = parser.parse_args()

# Ensure the input image folder exists
Expand All @@ -25,7 +26,8 @@
image_folder = os.path.expanduser(args.image_folder)

# Set the output file name and path
output_file = os.path.join(image_folder, 'md_out.json')
output_dir = os.path.expanduser(args.output_dir)
output_file = os.path.join(output_dir, 'md_out.json')

# Recursively find images in the folder
image_file_names = path_utils.find_images(image_folder, recursive=True)
Expand Down

0 comments on commit 9dbe4e7

Please sign in to comment.