Let machine M be the Main machine with the repo, and A the Auxiliary machine which wants to help out.
- Machine M creates bundle with complete repo:
git bundle create repo.bundle HEAD master
- M sends
repo.bundle
to A. - A clones repo from bundle:
""" | |
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) |
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 |
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 |
A list of useful commands for the ffmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
First of all: YUV pixel formats and Recommended 8-Bit YUV Formats for Video Rendering. Chromium's source code contains good documentation about those formats too: chromium/src/media/base/video_types.h and chromium/src/media/base/video_frame.cc (search for RequiresEvenSizeAllocation()
, NumPlanes()
and those kinds of functions).
You can think of an image as a superposition of several planes (or layers in a more natural language). YUV formats have three planes: Y
, U
, and V
.
Y
is the luma plane, and can be seen as the image as grayscale. U
and V
are reffered to as the chroma planes, which are basically the colours. All the YUV formats have these three planes, and differ by the different orderings of them.