Skip to content

Instantly share code, notes, and snippets.

@RichardSlater
Created March 26, 2022 20:08
Show Gist options
  • Save RichardSlater/b1783707d23e6f422f98f645cdcda059 to your computer and use it in GitHub Desktop.
Save RichardSlater/b1783707d23e6f422f98f645cdcda059 to your computer and use it in GitHub Desktop.
Medium.com: Creating AI Art? Has your Super-SloMo model stopped working?
from google.colab import drive
drive.mount('/content/drive')
from os.path import exists
def download_from_google_drive(file_id, file_name):
# download a file from the Google Drive link
!rm -f ./cookie
!curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id={file_id}" > /dev/null
confirm_text = !awk '/download/ {print $NF}' ./cookie
confirm_text = confirm_text[0]
!curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm={confirm_text}&id={file_id}" -o {file_name}
pretrained_model = 'SuperSloMo.ckpt'
if not exists(pretrained_model):
download_from_google_drive('1uok9sHVx8FwttH5N3m-CmcauIfR1XBvd', pretrained_model)
pretrained_model = '/content/drive/MyDrive/Super-SloMo/shared-checkpoints/SuperSloMo-Python36+0.4.1+cu92-epoch200.ckpt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment