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

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ build/
dist/ dist/
*.spec *.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): def parse_args(argv=None):
parser = argparse.ArgumentParser() 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( parser.add_argument(
"--sequence_ids", "--sequence_ids",
type=str, type=str,
@ -47,6 +47,12 @@ def parse_args(argv=None):
default=None, default=None,
help="How many images you want to download", 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( parser.add_argument(
"--overwrite", "--overwrite",
default=False, default=False,
@ -231,7 +237,7 @@ if __name__ == "__main__":
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor: with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
for i, image_data in enumerate(images_data): for i, image_data in enumerate(images_data):
# create a folder for each unique sequence ID to group images by sequence # 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): if not os.path.exists(path_destination):
os.makedirs(path_destination) os.makedirs(path_destination)
date_time_image_filename = ( date_time_image_filename = (