Ejemplo n.º 1
0
                threads.append(th)
                if len(threads) >= max_threads:
                    for th in threads:
                        th.join()
                        with open(ignores_txt, "a") as ignores:
                            ignores.write(th.name + '\n')
                    threads = []
        for th in threads:
            th.join()
            with open(ignores_txt, "a") as ignores:
                ignores.write(th.name + '\n')

    if args.downloadBoundingBox is True:
        for id in args.wnid:
            # Download annotation files
            downloader.downloadBBox(id)

    if args.downloadOriginalImages is True:
        # Download original image, but need to set key and username
        if username is None or accessKey is None:
            username = raw_input('Enter your username : '******'Enter your accessKey : ')
            if username and accessKey:
                pref_utils.saveUserInfo(username, accessKey)

        if username is None or accessKey is None:
            print('need username and accessKey to download original images')
        else:
            for id in args.wnid:
                downloader.downloadOriginalImages(id, username, accessKey)
Ejemplo n.º 2
0
    username = None
    accessKey = None
    userInfo = pref_utils.readUserInfo()
    if not userInfo is None:
        username = userInfo[0]
        accessKey = userInfo[1]

    if args.downloadImages is True:
        for id in args.wnid:
            list = downloader.getImageURLsOfWnid(id)
            downloader.downloadImagesByURLs(id, list)

    if args.downloadBoundingBox is True:
        for id in args.wnid:
            # Download annotation files
            downloader.downloadBBox(id)

    if args.downloadOriginalImages is True:
    # Download original image, but need to set key and username
        if username is None or accessKey is None:
            username = raw_input('Enter your username : '******'Enter your accessKey : ')
            if username and accessKey:
                pref_utils.saveUserInfo(username, accessKey)

        if username is None or accessKey is None:
            print 'need username and accessKey to download original images'
        else:
            for id in args.wnid:
                downloader.downloadOriginalImages(id, username, accessKey)