ignore generated script bash, add param for username subfolder in data

This commit is contained in:
Tykayn 2024-12-13 13:03:46 +01:00 committed by tykayn
parent b43cacea56
commit ac78ace1b7
2 changed files with 10 additions and 3 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@ __pycache__/
build/
dist/
*.spec
secrets_variables.sh
secrets_variables.sh
script_bash_get*

View File

@ -22,7 +22,7 @@ session.mount("https://", HTTPAdapter(max_retries=retries_strategies))
def parse_args(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument("access_token", type=str, help="Your mapillary access token")
parser.add_argument("--access_token", type=str, help="Your mapillary access token")
parser.add_argument(
"--sequence_ids",
type=str,
@ -47,6 +47,12 @@ def parse_args(argv=None):
default=None,
help="How many images you want to download",
)
parser.add_argument(
"--username",
type=str,
default=None,
help="The username to separate sequences for each user",
)
parser.add_argument(
"--overwrite",
default=False,
@ -231,7 +237,7 @@ if __name__ == "__main__":
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
for i, image_data in enumerate(images_data):
# create a folder for each unique sequence ID to group images by sequence
path_destination = os.path.join(args.destination, image_data["sequence_id"])
path_destination = os.path.join(args.destination, args.username, image_data["sequence_id"])
if not os.path.exists(path_destination):
os.makedirs(path_destination)
date_time_image_filename = (