This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! pip install kaggle | |
! mkdir ~/.kaggle | |
!cp /content/drive/MyDrive/kaggle.json ~/.kaggle/kaggle.json | |
# AN INDIVIDUAL .ckpt FILE | |
LINK='omgsupportteam/dd-tb-fine-22-10-11-22-42-36' | |
FILENAME = 'last.ckpt' | |
! kaggle datasets download $LINK -f $FILENAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, json | |
from dateutil.parser import parse | |
from datetime import datetime, timezone, timedelta | |
with open("/var/colab/app.log", 'r') as fileData: | |
for textline in fileData: | |
if " started" in textline: | |
time = parse (json.loads(textline)['time']) | |
now = datetime.now(time.tzinfo) | |
later = time + timedelta(hours=4) | |
print(now-time, "session started") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
def prune_it(p): | |
print(f"prunin' in path: {p}") | |
size_initial = os.path.getsize(p) | |
nsd = dict() | |
sd = torch.load(p, map_location="cpu") | |
print(sd.keys()) | |
for k in sd.keys(): | |
if k != "optimizer_states": | |
nsd[k] = sd[k] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAMEZIP = f"/content/drive/MyDrive/AI/models/DanceDiffusion/finetune/{NAME}/{NAME}_zipped_demos.7z" | |
!7z a -t7z $NAMEZIP /content/sample-generator/*.wav |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!rsync -a /content/drive/MyDrive/PathToSamples/ /content/Temp | |
!tar -zcf /content/normalized.gz /content/Temp | |
!cp /content/normalized.gz /content/drive/MyDrive/PathForZip/normalized.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Award Winning detailed, archviz style, extreme detail,The inside of a monument designed by Friedensreich Hundertwasser and Antonin Gaudi, octane render, warm colour scheme, white, cinematic, scenery, high detail, high quality, close up angle, people walking | |
Width was set to 832 | |
Height was 512 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beautiful oil painting of tracer from the game overwatch in the style of delphin enjolras, standing alone in grassy field, smiling while the sun shines down, feminine face, light rays, radiant quality, 4 k, brush strokes, beautiful eyes, peaceful atmosphere, artstation, heavenly glow, tracer overwatch, tracer face, detailed face, smiling, tracer vizor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from PIL import ImageFont | |
from PIL import ImageDraw | |
import math | |
#Self contain this for easy single clicking | |
from PIL import Image | |
def image_grid(imgs, rows, cols): | |
#assert len(imgs) == rows*cols | |
w, h = imgs[0].size | |
grid = Image.new('RGB', size=(cols*w, rows*h)) |