This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffmpeg -i <audio.aac> -acodec libmp3lame <audio.mp3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 一部抜粋 | |
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| FileName: ReductionSample.cpp | |
| Discription:行列演算ライブラリEigenの換算関数のサンプル | |
| Author: Atsushi Sakai | |
| Update: 2013/03/23 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 {})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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 |
OlderNewer