download.py 385 字节
Newer Older
H
haoyuying 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import os

from paddlehub.env import DATA_HOME
from paddle.utils.download import get_path_from_url


def download_data(url):
    save_name = os.path.basename(url).split('.')[0]
    output_path = os.path.join(DATA_HOME, save_name)

    if not os.path.exists(output_path):
        get_path_from_url(url, DATA_HOME)

    def _wrapper(Dataset):
        return Dataset

    return _wrapper