Skip to content

Instantly share code, notes, and snippets.

View sberryman's full-sized avatar
🏠
Working from home

Shaun Berryman sberryman

🏠
Working from home
View GitHub Profile
@karpathy
karpathy / stablediffusionwalk.py
Last active October 1, 2024 09:56
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
@CasiaFan
CasiaFan / ffmpeg_python_with_gpu_acceleration.py
Created September 8, 2019 16:35
Use pipe to read ffmped decoded video frames with NVIDIA GPU hardware acceleration
import subprocess as sp
import cv2
import numpy as np
from PIL import Image
import tensorflow as tf
ffmpeg_cmd_1 = ["./ffmpeg", "-y",
"-hwaccel", "nvdec",
"-c:v", "h264_cuvid",
"-vsync", "0",
@alper111
alper111 / vgg_perceptual_loss.py
Last active November 17, 2024 13:43
PyTorch implementation of VGG perceptual loss
import torch
import torchvision
class VGGPerceptualLoss(torch.nn.Module):
def __init__(self, resize=True):
super(VGGPerceptualLoss, self).__init__()
blocks = []
blocks.append(torchvision.models.vgg16(pretrained=True).features[:4].eval())
blocks.append(torchvision.models.vgg16(pretrained=True).features[4:9].eval())
blocks.append(torchvision.models.vgg16(pretrained=True).features[9:16].eval())
@WIStudent
WIStudent / Instructions.md
Last active November 16, 2018 08:15
Compiling DeepMatching's GPU version on Ubuntu 16.10

Compiling DeepMatching's GPU version on Ubuntu 16.10

DeepMatching is an algorithm that finds corresponding points in two images. Its GPU implementation was written for Fedora 21, which makes things a bit more difficult if you want to run it on an Ubuntu system. This document contains step-by-step instructions on how to get DeepMatching running on Ubuntu 16.10. I only tested it with Ubuntu 16.10, just let me know if it works with previous versions too.

To compile the GPU version you first need to compile the Caffe version that is included that comes with the DeepMatching files. Newer versions of Caffe won't work because Caffe changed the structure of its header files.

Compiling Caffe

Before compiling Caffe we need to make sure all its dependencies are installed. From the installation guide for Ubuntu 16.04/15.10:

sudo apt-get install build-essential cmake git pkg-config
@simme
simme / debounce-throttle.swift
Created December 20, 2016 10:04
Swift 3 debounce & throttle
//
// debounce-throttle.swift
//
// Created by Simon Ljungberg on 19/12/16.
// License: MIT
//
import Foundation
extension TimeInterval {
@ishay2b
ishay2b / readme.md
Last active March 30, 2019 23:55
Vanilla CNN caffe model
name caffemodel caffemodel_url license sha1 caffe_commit
Vanilla CNN Model
vanillaCNN.caffemodel
unrestricted
b5e34ce75d078025e07452cb47e65d198fe27912
9c9f94e18a8909580a6b94c44dbb1e46f0ee8eb8

Implementation of the Vanilla CNN described in the paper: Yue Wu and Tal Hassner, "Facial Landmark Detection with Tweaked Convolutional Neural Networks", arXiv preprint arXiv:1511.04031, 12 Nov. 2015. See project page for more information about this project.

@GilLevi
GilLevi / README.md
Last active June 17, 2023 20:58
Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns

Gil Levi and Tal Hassner, Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns

Convolutional neural networks for emotion classification from facial images as described in the following work:

Gil Levi and Tal Hassner, Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns, Proc. ACM International Conference on Multimodal Interaction (ICMI), Seattle, Nov. 2015

Project page: http://www.openu.ac.il/home/hassner/projects/cnn_emotions/

If you find our models useful, please add suitable reference to our paper in your work.

@GilLevi
GilLevi / README.md
Last active July 25, 2023 18:05
Age and Gender Classification using Convolutional Neural Networks
@jstrimpel
jstrimpel / base.js
Last active August 29, 2015 14:09
mongodb collection syncher example
// app/server/synchers/base.js
define(['lazoSyncher'], function (LazoSyncher) {
'use strict';
// set up mongo connection here; not sure of best practices for establishing connections
// https://www.npmjs.org/package/mongodb
return LazoSyncer.extend({
@joyrexus
joyrexus / README.md
Last active September 7, 2024 14:28
Form/file uploads with hapi.js

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...