Skip to content

Instantly share code, notes, and snippets.

View krismatson's full-sized avatar

Kris Matson krismatson

  • Denver CO / Raleigh NC / Tucson AZ
View GitHub Profile

Keybase proof

I hereby claim:

  • I am krismatson on github.
  • I am krismatson (https://keybase.io/krismatson) on keybase.
  • I have a public key ASAKMDqTUdFcLJU8F9pIjU8m76eP4hRI0McPmHi7Oen1dgo

To claim this, I am signing this object:

@krismatson
krismatson / video_to_frames.py
Created May 1, 2018 10:54 — forked from JacopoDaeli/video_to_frames.py
Extract frames from pre-recored video with Python and OpenCV
import cv2
def video_to_frames(video_filename):
"""Extract frames from video"""
cap = cv2.VideoCapture(video_filename)
video_length = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) - 1
frames = []
if cap.isOpened() and video_length > 0:
frame_ids = [0]
if video_length >= 4:
@krismatson
krismatson / min-char-rnn.py
Created April 30, 2018 22:53 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)