20
20
21
21
22
22
def _download_cli (cfg , is_cli_call = True ):
23
- '''Download all samples in a given tag.
24
- If input_dir and output_dir are specified, a copy of all images
25
- in the tag will be stored in the output directory.
26
-
27
- Args:
28
- cfg['input_dir']: (str, optional)
29
- Path to folder which holds all images from the dataset
30
- cfg['output_dir']: (str, optional)
31
- Path to folder where the copied images will be stored
32
- cfg['tag_name']: (str) Name of the requested tag
33
- cfg['dataset_id']: (str) Dataset identifier on the platform
34
- cfg['token']: (str) Token which grants access to the platform
35
-
36
- '''
37
23
38
24
tag_name = cfg ['tag_name' ]
39
25
dataset_id = cfg ['dataset_id' ]
40
26
token = cfg ['token' ]
41
27
42
28
if not tag_name :
43
29
print ('Please specify a tag name' )
44
- print ('For help, try: lightly-upload --help' )
30
+ print ('For help, try: lightly-download --help' )
45
31
return
46
32
47
33
if not token or not dataset_id :
48
34
print ('Please specify your access token and dataset id' )
49
- print ('For help, try: lightly-upload --help' )
35
+ print ('For help, try: lightly-download --help' )
50
36
return
51
37
52
38
# get all samples in the queried tag
@@ -62,6 +48,9 @@ def _download_cli(cfg, is_cli_call=True):
62
48
with open (cfg ['tag_name' ] + '.txt' , 'w' ) as f :
63
49
for item in samples :
64
50
f .write ("%s\n " % item )
51
+ msg = 'The list of files in tag {} is stored at: ' .format (cfg ['tag_name' ])
52
+ msg += os .path .join (os .getcwd (), cfg ['tag_name' ] + '.txt' )
53
+ print (msg )
65
54
66
55
if cfg ['input_dir' ] and cfg ['output_dir' ]:
67
56
# "name.jpg" -> "/name.jpg" to prevent bugs like this:
0 commit comments