Skip to content

Instantly share code, notes, and snippets.

@iCUE-Solutions
Created February 3, 2024 21:49
Show Gist options
  • Save iCUE-Solutions/4b9c4fa6d7de7e40ddd4e5f50615e383 to your computer and use it in GitHub Desktop.
Save iCUE-Solutions/4b9c4fa6d7de7e40ddd4e5f50615e383 to your computer and use it in GitHub Desktop.
fishail models
import os
import requests
def download_models():
# Create MODELS folder if it doesn't exist
if not os.path.exists('../com.docker.devenvironments.code/MODELS'):
os.makedirs('../com.docker.devenvironments.code/MODELS')
# Dictionary of URLs and corresponding filenames
urls = {
'https://storage.googleapis.com/fishial-ml-resources/models_29.06.2022/model_0259999.pth': 'MODELS/model_0259999.pth',
'https://storage.googleapis.com/fishial-ml-resources/final_cross_cross_entropy_0.9923599320882852_258571.0.ckpt': 'MODELS/final_cross_cross_entropy_0.9923599320882852_258571.0.ckpt',
'https://storage.cloud.google.com/fishial-ml-resources/binary_class.ckpt': 'MODELS/binary_class.ckpt',
'https://storage.googleapis.com/fishial-ml-resources/models_29.06.2022/full_256.ckpt': 'MODELS/full_256.ckpt',
'https://storage.googleapis.com/fishial-ml-resources/models_29.06.2022/train%2Btest_embedding.pt': 'MODELS/train+test_embedding.pt',
'https://storage.googleapis.com/fishial-ml-resources/classification_v5.zip': 'MODELS/classification_v5.zip',
'https://storage.googleapis.com/fishial-ml-resources/model_15_11_2022.pth': 'MODELS/model_15_11_2022.pth',
'https://storage.googleapis.com/fishial-ml-resources/classification_22_12.zip': 'MODELS/classification_22_12.zip',
'https://storage.googleapis.com/fishial-ml-resources/classification_fishial_30_06_2023.zip': 'MODELS/classification_fishial_30_06_2023.zip',
'https://storage.googleapis.com/fishial-ml-resources/model_21_08_2023.pth': 'MODELS/model_21_08_2023.pth',
'https://storage.googleapis.com/fishial-ml-resources/segmentation_21_08_2023.ts': 'MODELS/segmentation_21_08_2023.ts',
'https://storage.googleapis.com/fishial-ml-resources/classification_fishial_08_09_2023.zip': 'MODELS/classification_fishial_08_09_2023.zip'
}
downloaded_files = [] # List to store the downloaded filenames
# Download and save the files
for url, filename in urls.items():
response = requests.get(url)
with open(filename, 'wb') as file:
file.write(response.content)
downloaded_files.append(filename) # Add the filename to the list
return downloaded_files # Return the list of downloaded filenames
# Call the function to download the models
downloaded_files = download_models()
# Print the downloaded filenames
for filename in downloaded_files:
print(filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment