Skip to content

Instantly share code, notes, and snippets.


Shannon magsol

View GitHub Profile
magsol / gist:f2961e0c8bfeee56339973773c8b6d8a
Last active Aug 5, 2020
ffmpeg video format conversion
View gist:f2961e0c8bfeee56339973773c8b6d8a
# converts vidfile.avi to
# re-encodes video using h264 codec
# This is good for, e.g., creating a video to post to instagram.
ffmpeg -i vidfile.avi -c:v h264
# This is good for, e.g., creating a video to embed in PPTX.
ffmpeg -i vidfile.avi -pix_fmt yuv420p
# see the list of available codecs
# This function was written as part of the analysis pipeline in
# Lu et al 2018, IEEE ISBI:
# The purpose of this function was to convert the predicted mask
# of cilia into an empirical probability density function that we
# would then sample "seeds" from to extract patches of ciliary motion
# (with high probability; hence, the empirical PDF) to feed to the
# downstream Conv-LSTM for classification. The reason we didn't
# just uniformly sample from the masked areas of cilia was to try
# and minimize uncertainty in the mask edges (hence, the distance
magsol /
Last active May 24, 2017
Simple script to edit the OpenCV conda-forge feedstock's build script to enable CUDA support.
# Installs a GPU-enabled OpenCV from the conda-forge feedstock.
# Assumes you already have Python 3 installed and the conda-forge channel on.
import argparse
import os.path
import subprocess
import sys
# These are the options we want to make sure are set to the values listed here.
magsol /
Created May 4, 2017
An animated 3D matplotlib figure that rotates incrementally as the plot is drawn.
import argparse
import matplotlib.pyplot as plot
from matplotlib import animation
from mpl_toolkits.mplot3d.axes3d import Axes3D
import numpy as np
import as AR
if __name__ == "__main__":
parser = argparse.ArgumentParser(description = 'Cilia AR Subspace Plotting',
magsol /
Last active Oct 4, 2016
BlueData Worker reformat and reinstall
# Register each worker.
# Make sure each worker is subscribed to the RHEL channels:
# - RHEL Server Optional
# - RHEL Server Supplementary
# - RHN Tools for RHEL
# Run on each worker.
yum -y update
magsol /
Last active Jan 29, 2019
Attempts to get the Amazon Dash button working with Hue lights.
magsol /
Last active May 23, 2017
Python packages I use.
magsol /
Created Jun 2, 2015
FERET binary to PNG image parser
import argparse
import bz2
import os
if __name__ == "__main__":
parser = argparse.ArgumentParser(description = 'FERET Parser',
epilog = 'lol moar p1cz', add_help = 'How to use',
prog = 'python <args>')
# Required parameters.
magsol / OpenCV Introduction.ipynb
Created Dec 2, 2013
IPython notebook introducing the basics of OpenCV.
View OpenCV Introduction.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.