File size: 1,025 Bytes
55315c3 422ac71 55315c3 422ac71 55315c3 422ac71 |
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 |
from huggingface_hub import hf_hub_url, cached_download
from huggingface_hub.archive import unpack_archive
def downlad_images() :
img_dir = 'flickr'
if not os.path.exists(img_dir) :
st.write("NEEED to download")
# os.makedirs(sample_dir, exist_ok=True)
# # Specify the Google Drive link to the archive file
# archive_url = 'https://drive.google.com/uc?id=14QhofCbby053kWbVeWEBHCxOROQS-bjN'
# # Specify the destination directory within the Hugging Face space
# destination_dir = 'osanchik/flickr'
# # Replace with your desired destination directory
# # Construct the destination path
# destination_path = hf_hub_url(destination_dir)
# # Download the archive to the destination path
# cached_download(archive_url, destination_path)
# # Unpack the archive
# unpack_archive(destination_path, destination_dir)
# print(f"Archive unpacked to: {destination_dir}")
return |