Skip to content

Instantly share code, notes, and snippets.


Vishal Jain jainxy

  • Bengaluru, India
View GitHub Profile
HaydenFaulkner /
Created Jul 15, 2020
decord version of
import cv2 # still used to save images out
import os
import numpy as np
from decord import VideoReader
from decord import cpu, gpu
def extract_frames(video_path, frames_dir, overwrite=False, start=-1, end=-1, every=1):
Extract frames from a video using decord's VideoReader
HaydenFaulkner /
Last active Feb 9, 2021
Fast frame extraction from videos using Python and OpenCV
from concurrent.futures import ProcessPoolExecutor, as_completed
import cv2
import multiprocessing
import os
import sys
def print_progress(iteration, total, prefix='', suffix='', decimals=3, bar_length=100):
Call in a loop to create standard out progress bar
PHPirates /
Last active Apr 29, 2021
How to use git bundles

Let machine M be the Main machine with the repo, and A the Auxiliary machine which wants to help out.

First time setup

  1. Machine M creates bundle with complete repo:
git bundle create repo.bundle HEAD master
  1. M sends repo.bundle to A.
  2. A clones repo from bundle:
steven2358 /
Last active May 18, 2021
FFmpeg cheat sheet
aparrish / understanding-word-vectors.ipynb
Last active May 17, 2021
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0, other text released under CC BY 4.0
View understanding-word-vectors.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
nasrulhazim /
Last active May 6, 2021
Download Files From FTP Server using Python3
from ftplib import FTP
from datetime import datetime

start =
ftp = FTP('your-ftp-domain-or-ip')

# Get All Files
files = ftp.nlst()
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created Feb 19, 2017
complete list of ffmpeg flags / commands
View gist:6e2d456a9897f55025e25035478a3a50
Originall From: Posted 2015-05-29
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not
karpathy /
Last active May 18, 2021
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)