Skip to content

Instantly share code, notes, and snippets.

#### 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:
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):
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
@Hiromi-nee
Hiromi-nee / README-CodiMD-Restore.md
Created July 21, 2022 14:34 — forked from Himura2la/README-CodiMD-Restore.md
CodiMD Backup and Restore
@Hiromi-nee
Hiromi-nee / stablediffusionwalk.py
Created August 19, 2022 09:08 — forked from karpathy/stablediffusionwalk.py
hacky stablediffusion code for generating videos
"""
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