import os
import mmcv
import urllib.request

dir_path = os.path.dirname(os.getcwd())

labelbox_file = dir_path + '/cleaning/export-2019-07-11T20_41_53.065Z.json'
out_dir = dir_path + '/cleaning/711_with_rotate/'


def main():
    mmcv.mkdir_or_exist(out_dir)

    items = mmcv.load(labelbox_file)
    print('downloading {} images. '.format(len(items)))

    count = 1
    for item in items:
        name = item['DataRow ID']
        image_link = item['Labeled Data']

        # img_data = requests.get(image_link).content
        # with open(out_dir+'{}.jpg'.format(name), 'wb') as handler:
        #     handler.write(img_data)
        urllib.request.urlretrieve(image_link, out_dir+'{}'.format(name))

        print(count)
        count = count + 1


if __name__ == '__main__':
    main()

1e21d36b6d7ed9f6f911ac474d6c625cf28c98b9
<mask token>

<mask token>


def main():
    mmcv.mkdir_or_exist(out_dir)
    items = mmcv.load(labelbox_file)
    print('downloading {} images. '.format(len(items)))
    count = 1
    for item in items:
        name = item['DataRow ID']
        image_link = item['Labeled Data']
        urllib.request.urlretrieve(image_link, out_dir + '{}'.format(name))
        print(count)
        count = count + 1


if __name__ == '__main__':
    main()

<mask token>
dir_path = os.path.dirname(os.getcwd())
labelbox_file = dir_path + '/cleaning/export-2019-07-11T20_41_53.065Z.json'
out_dir = dir_path + '/cleaning/711_with_rotate/'


def main():
    mmcv.mkdir_or_exist(out_dir)
    items = mmcv.load(labelbox_file)
    print('downloading {} images. '.format(len(items)))
    count = 1
    for item in items:
        name = item['DataRow ID']
        image_link = item['Labeled Data']
        urllib.request.urlretrieve(image_link, out_dir + '{}'.format(name))
        print(count)
        count = count + 1


if __name__ == '__main__':
    main()

import os
import mmcv
import urllib.request
dir_path = os.path.dirname(os.getcwd())
labelbox_file = dir_path + '/cleaning/export-2019-07-11T20_41_53.065Z.json'
out_dir = dir_path + '/cleaning/711_with_rotate/'


def main():
    mmcv.mkdir_or_exist(out_dir)
    items = mmcv.load(labelbox_file)
    print('downloading {} images. '.format(len(items)))
    count = 1
    for item in items:
        name = item['DataRow ID']
        image_link = item['Labeled Data']
        urllib.request.urlretrieve(image_link, out_dir + '{}'.format(name))
        print(count)
        count = count + 1


if __name__ == '__main__':
    main()

import os
import mmcv
import urllib.request

dir_path = os.path.dirname(os.getcwd())

labelbox_file = dir_path + '/cleaning/export-2019-07-11T20_41_53.065Z.json'
out_dir = dir_path + '/cleaning/711_with_rotate/'


def main():
    mmcv.mkdir_or_exist(out_dir)

    items = mmcv.load(labelbox_file)
    print('downloading {} images. '.format(len(items)))

    count = 1
    for item in items:
        name = item['DataRow ID']
        image_link = item['Labeled Data']

        # img_data = requests.get(image_link).content
        # with open(out_dir+'{}.jpg'.format(name), 'wb') as handler:
        #     handler.write(img_data)
        urllib.request.urlretrieve(image_link, out_dir+'{}'.format(name))

        print(count)
        count = count + 1


if __name__ == '__main__':
    main()
