-
Ensure a docker-compose.yml file exists inside a
codimd
directory. -
Put the restore.sh script near it.
-
Follow the script below:
This file contains 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
""" | |
stable diffusion dreaming | |
creates hypnotic moving videos by smoothly walking randomly through the sample space | |
example way to run this script: | |
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry | |
to stitch together the images, e.g.: | |
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4 |
This file contains 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 glob, os | |
import sys | |
def yolo_reader(annotation_file): | |
with open(annotation_file, 'r') as f: | |
data = f.read() | |
data = data.split("\n") | |
return data |
This file contains 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 numpy as np | |
from sklearn.metrics import confusion_matrix | |
import itertools | |
class_names = list(range(200)) | |
import matplotlib.pyplot as plt | |
def plot_confusion_matrix(cm, classes, | |
normalize=False, | |
title='Confusion matrix', | |
cmap=plt.cm.Blues): |
This file contains 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
#### Function Examples #### | |
## New Function Introduction: isinstance(variable, type) | |
## Given a variable (e.g.: a,b,c) and a specific type (int, float, bool, str, list, dict, etc) | |
## isinstance(variable, type) checks if variable is of the specified type and returns True or False | |
## e.g.: | |
## a = 1 | |
## isinstance(a, int) --returns--> True | |
## isinstance(a, str) --returns--> False | |
## Note the following: |
This file contains 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
# Mount google drive | |
# https://colab.research.google.com/notebooks/io.ipynb#scrollTo=RWSJpsyKqHjH | |
from google.colab import drive | |
drive.mount('/content/gdrive') |
This file contains 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
# This assumes your model is ready to be called with .predict() | |
sess = keras.get_session() | |
graph = sess.graph | |
graph_dev = graph.as_graph_def() | |
frozen_graph = tf.graph_util.convert_variables_to_constants( | |
sess, graph_def, nodes_to_output) | |
encoded_frozen_graph = frozen_graph.SerializeToString() |
This file contains 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
#%%bash | |
#echo "Start resizing to 227x227" | |
#parallel -j 200 convert {} -resize 227x227 -filter spline -unsharp 0x6+0.5+0 -background black -gravity center -extent 227x227 {} ::: *.jpg | |
#echo "Resizing done" | |
#mkdir flop | |
#echo "Start augmentation 1" | |
#parallel -j 200 convert {} -flop flop/{.}-flop.jpg ::: *.jpg | |
#echo "Finish augmetation 1" |
This file contains 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 requests | |
def download_file_from_google_drive(id, destination): | |
URL = "https://docs.google.com/uc?export=download" | |
session = requests.Session() | |
response = session.get(URL, params = { 'id' : id }, stream = True) | |
token = get_confirm_token(response) |
NewerOlder