Skip to content

Instantly share code, notes, and snippets.

@willprice
willprice / KINETICS_LABELS.md
Last active April 25, 2024 10:24
Kinetics Dataset Labels (name to ID)

Kinetics Numeric/String labels

These are mapping files that go between class IDs to class names. These are generated from the training CSV files from each dataset by collecting the unique classes, sorting them, and then numbering them from 0 upwards.

@willprice
willprice / PBS_PRO_CHEAT_SHEET.md
Last active March 22, 2024 05:34
PBS pro cheat sheet

PBS Pro command cheat sheet

List nodes and their features

$ pbsnodes

@willprice
willprice / relative_symlink.py
Created August 5, 2020 13:47
Create relative symlinks in python
@willprice
willprice / pillow-simd-libjpeg-turbo.md
Created February 28, 2021 09:52
Pillow-SIMD with libjpeg/turbo
# The following steps are based on
# https://docs.fast.ai/performance.html#installation

$ conda install -y -c conda-forge gxx_linux-64 
$ conda uninstall -y --force jpeg libtiff
$ conda install -y -c conda-forge libjpeg-turbo --no-deps
$ pip uninstall -y pillow
$ export CXX=x86_64-conda-linux-gnu-g++
$ export CC=x86_64-conda-linux-gnu-gcc
@willprice
willprice / .travis.yml
Last active August 15, 2023 17:12
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@willprice
willprice / stack.py
Last active June 20, 2023 14:27
PIL Image stacking
import numpy as np
from PIL import Image
def vstack(images):
if len(images) == 0:
raise ValueError("Need 0 or more images")
if isinstance(images[0], np.ndarray):
images = [Image.fromarray(img) for img in images]
width = max([img.size[0] for img in images])
@willprice
willprice / gist:cb9452b1b2a32eae7fb20daa5bd09958
Created March 2, 2021 10:49
TP-LINK Archer WiFi adapters on linux
USB ID 2357:0120 -> https://github.com/aircrack-ng/rtl8812au
USB ID 2357:0138 -> https://github.com/RinCat/RTL88x2BU-Linux-Driver (follow the manual DKMS setup guide)
@willprice
willprice / README.md
Last active February 8, 2023 21:27
Install OpenCV 4.1.2 for Raspberry Pi 3 or 4 (Raspbian Buster)

Install OpenCV 4.1.2 on Raspbian Buster

$ chmod +x *.sh
$ ./download-opencv.sh
$ ./install-deps.sh
$ ./build-opencv.sh
$ cd ~/opencv/opencv-4.1.2/build
$ sudo make install

FFmpeg Cheatsheet for video ML practitioners

Dump single frame from a video:

$ ffmpeg -ss 0.5 -i in.mp4 -t 1 -s 1920x1080 -f image2 out.jpg
# -ss specifies the start position in seconds, or timestamp
# -t the number of frames, in this case 1
# -s size of output
# -f image2 forces image output