Skip to content

Instantly share code, notes, and snippets.

Avatar

Vishal Jain jainxy

  • Bengaluru, India
View GitHub Profile
@jainxy
jainxy / git-bundles.md
Created Feb 23, 2021 — forked from PHPirates/git-bundles.md
How to use git bundles
View git-bundles.md

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:
@jainxy
jainxy / video_to_frames.py
Created Sep 19, 2020 — forked from HaydenFaulkner/video_to_frames.py
Fast frame extraction from videos using Python and OpenCV
View video_to_frames.py
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
@jainxy
jainxy / video_to_frames_decord.py
Created Sep 19, 2020 — forked from HaydenFaulkner/video_to_frames_decord.py
decord version of video_to_frame.py
View video_to_frames_decord.py
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
@jainxy
jainxy / understanding-word-vectors.ipynb
Created Jun 7, 2020 — forked from aparrish/understanding-word-vectors.ipynb
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 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/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.
@jainxy
jainxy / min-char-rnn.py
Created Feb 14, 2020 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
View min-char-rnn.py
"""
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)