Skip to content

Instantly share code, notes, and snippets.

View yuki-inaho's full-sized avatar

yuki-inaho

View GitHub Profile
@quantombone
quantombone / nms_fast.m
Created August 14, 2011 00:26
blazing fast nms (non-maximum suppression)
function top = nms(boxes, overlap)
% top = nms_fast(boxes, overlap)
% Non-maximum suppression. (FAST VERSION)
% Greedily select high-scoring detections and skip detections
% that are significantly covered by a previously selected
% detection.
% NOTE: This is adapted from Pedro Felzenszwalb's version (nms.m),
% but an inner loop has been eliminated to significantly speed it
% up in the case of a large number of boxes
% Tomasz Malisiewicz (tomasz@cmu.edu)
@pcdinh
pcdinh / gist:1743283
Created February 5, 2012 05:49 — forked from srid/gist:1502656
Asynchronous run command lazily yielding command output (Python gevent)
def run_seq(cmd):
"""Run `cmd` and yield its output lazily"""
p = subprocess.Popen(
cmd, shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
# make STDIN and STDOUT non-blocking
fcntl.fcntl(p.stdin, fcntl.F_SETFL, os.O_NONBLOCK)
@rymawby
rymawby / convert-aac-to-mp3.sh
Created October 19, 2012 15:56
Convert aac to mp3 using ffmpeg
ffmpeg -i <audio.aac> -acodec libmp3lame <audio.mp3>
@flada-auxv
flada-auxv / .zshrc
Created November 10, 2012 05:37
tmuxの設定関連
# 一部抜粋
# emacsのエイリアス
alias e='emacsclient -t'
alias kille="emacsclient -e '(kill-emacs)'"
if pgrep emacs >/dev/null 2>&1; then
echo "Emacs server is already running..."
else
`emacs --daemon`
fi
@AtsushiSakai
AtsushiSakai / ReductionSample.cpp
Created March 23, 2013 11:24
行列演算ライブラリEigenの換算(Reduction)関連(平均,最大値,最小値,各行・列への演算)の関数サンプルプログラム
/*
FileName: ReductionSample.cpp
Discription:行列演算ライブラリEigenの換算関数のサンプル
Author: Atsushi Sakai
Update: 2013/03/23
@endolith
endolith / color_scale.py
Last active November 22, 2024 06:05
Lch color scale colormap in Python
"""
Created on Thu Feb 28 14:28:50 2013
Produces colormaps by curving through Lch color space, inspired by
"Lab color scale" by Steve Eddins 09 May 2006 (Updated 10 May 2006)
(BSD license)
http://www.mathworks.co.uk/matlabcentral/fileexchange/11037-lab-color-scale
Chroma should probably be limited to the RGB cube in a way that never
produces sharp angles in the curve, which appear as bands in the gradient.
@jeanpat
jeanpat / SkeletonToGraph.ipynb
Last active June 11, 2021 11:05
A ipython notebook. Takes an image, converts its skeleton to a networkx graph
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CarloNicolini
CarloNicolini / ralign
Created October 23, 2013 12:47
Umeyama algorithm for absolute orientation problem in Python
"""
RALIGN - Rigid alignment of two sets of points in k-dimensional
Euclidean space. Given two sets of points in
correspondence, this function computes the scaling,
rotation, and translation that define the transform TR
that minimizes the sum of squared errors between TR(X)
and its corresponding points in Y. This routine takes
O(n k^3)-time.
Inputs:
@carymrobbins
carymrobbins / partialmethod.py
Last active April 22, 2023 11:25
Partial method for Python 2.7
from functools import partial
class partialmethod(partial):
def __get__(self, instance, owner):
if instance is None:
return self
return partial(self.func, instance,
*(self.args or ()), **(self.keywords or {}))
@PaulFurtado
PaulFurtado / usb_reset.py
Last active June 22, 2024 22:44
Reset USB device from python
"""
Example code for resetting the USB port that a Teensy microcontroller is
attached to. There are a lot of situations where a Teensy or Arduino can
end up in a bad state and need resetting, this code is useful for
"""
import os
import fcntl
import subprocess