From f59c7f8f2a804c22e8715ed9731d80252e0cb31e Mon Sep 17 00:00:00 2001 From: YAKOV <57797470+outrun32@users.noreply.github.com> Date: Fri, 26 Jan 2024 16:35:58 +0300 Subject: [PATCH] Download fix (#20) * Fixed download.py * Fix download.py --- scripts/download.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/scripts/download.py b/scripts/download.py index 56c7383..bc9c74a 100644 --- a/scripts/download.py +++ b/scripts/download.py @@ -32,7 +32,7 @@ "-r", "--range", type=int, - default=2000, + default=None, help="Upper bound of range if -i is provided", ) parser.add_argument( @@ -69,14 +69,6 @@ if args.large: large = args.large -if ( - args.index and args.range and args.output and args.unzip and args.large is None -): # if no arguments are provided, set default behaviour - index = 1 - range_max = 2000 - output = "images" - unzip = False - large = False def download(index=1, range_index=0, output="", large=False): @@ -192,11 +184,11 @@ def main(index=None, range_max=None, output=None, unzip=None, large=None): images) instead of DiffusionDB 2M (2 million images) :return: A list of files that have been downloaded """ - if range_max - index > 1999: - confirmation = input("Do you have at least 1.7Tb free: (y/n)") - if confirmation != "y": - return if index and range_max: + if range_max - index >= 1999: + confirmation = input("Do you have at least 1.7Tb free: (y/n)") + if confirmation != "y": + return files = download(index, range_max, output, large) if unzip: unzip_all(files) @@ -211,4 +203,4 @@ def main(index=None, range_max=None, output=None, unzip=None, large=None): # to import the script into the interpreter without automatically running the # main function. if __name__ == "__main__": - main(index, range_max, output, unzip, large) + main(index, range_max, output, unzip, large) \ No newline at end of file