from re import I
import requests
import urllib.request
import os
import ssl
import tqdm
ssl._create_default_https_context = ssl._create_unverified_context
def download_img(urlPath, outPath):
urllib.request.urlretrieve(urlPath, filename=outPath)
urllib.request.urlcleanup()
if __name__ == "__main__":
os.makedirs('./image/', exist_ok=True)
os.makedirs('./mask/', exist_ok=True)
headers={
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36'
}
for i in tqdm.tqdm(range(730)):
imgUrl=f'https://zenodo.org/record/4601472/files/img_{i}.jpg?download=1'
imgOutPath = f'./image/img_{i}.jpg'
maskUrl=f'https://zenodo.org/record/4601472/files/img_{i}_refined_mask.jpg?download=1'
maskOutPath = f'./mask/img_{i}_refined_mask.jpg'
download_img(imgUrl, imgOutPath)
download_img(maskUrl, maskOutPath)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35