This file contains 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
/* | |
================================================================ | |
GIST FOR C++ FUNCTIONS | |
================================================================ | |
*/ | |
// Efficient way for looping a cv::Mat | |
uchar* p; | |
for (uint i = 0; i < (uint) mat.rows; i++) | |
{ |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<style-scheme version="1.0" name="Tomorrow-Night"> | |
<style name="Text" foreground="#e6e8e7" background="#0e0f10"/> | |
<style name="Link" foreground="#81a2be" background="#0e0f10"/> | |
<style name="Selection" background="#aa007f"/> | |
<style name="LineNumber" foreground="#373b41" background="#0e0f10"/> | |
<style name="SearchResult" foreground="#1d1f21" background="#aa007f"/> | |
<style name="SearchScope" foreground="#a8c5c2" background="#0e0f10"/> | |
<style name="Parentheses" foreground="#191a1a" background="#618d45"/> | |
<style name="CurrentLine" foreground="#c5c8c6" background="#676f76"/> |
This file contains 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
# Break a video into multiple fixed length segments | |
~/libs/ffmpeg-2.6.2/ffmpeg -i test3.mp4 -acodec copy -vcodec copy -map 0 -f segment -segment_time 10 -reset_timestamps 1 clips/test3__%05d.mp4 | |
# Decode and encode file to create accurate video segments | |
ffmpeg -i t2.mp4 -c:v libx264 -crf 22 -map 0 -segment_time 10 -g 10 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*10)" -f segment -reset_timestamps 1 out%04d.mp4 | |
# Iterate through all the files and run a command | |
base_dir=/media/chintaksheth/LB_Recordings_07/pilot/ | |
for f in $(find $base_dir -wholename "*.mp4"); do | |
new_dir=$(dirname $f)_clips/ |
This file contains 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
#!/bin/bash | |
path="$1" | |
echo "Changing directory to $path." | |
cd "$path" | |
while IFS= read -r -d '' f; do | |
filename="${f##*/}" | |
path="${f%/*}" | |
new_file=temp_"${filename//\ /_}" | |
out_file="${filename//\ /_}" |
This file contains 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
# Install pathogen package manager | |
mkdir -p ~/.vim/autoload ~/.vim/bundle && \ | |
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim | |
# Install other packages | |
cd ~/.vim/bundle | |
git clone https://github.com/nvie/vim-flake8.git |
This file contains 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
cpdef _inpaint_criminisi(cnp.float_t [:, ::1] painted, | |
cnp.int8_t [:, ::1] mask, | |
cnp.uint8_t window, | |
cnp.float_t ssd_thresh): | |
cdef: | |
cnp.float_t [:, ::1] source_image, confidence, gauss_mask, dx, dy | |
cnp.float_t [:, ::1] smooth_painted, template, valid_mask | |
cnp.int16_t [:, ::1] fill_front | |
cnp.int8_t [:, ::1] nx, ny, mask_template |
This file contains 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
# .bash_profile | |
#----------------------- | |
alias ls='ls -G' | |
alias ipn="cd ~/Notebooks/; ipython notebook --pylab=inline" | |
alias crp="cd ~/Documents/Repositories" | |
alias si2="workon skimage2; crp; cd scikit-image" | |
alias newvirtualenv="source ~/Documents/venv/new_env.sh $1" | |
export PS1="\e[0;31m\h: \W$ \e[m" |
This file contains 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
mkvirtualenv $1 | |
ln -ns ~/Documents/venv/dev_pack2/lib/python2.7/site-packages/* ~/Documents/venv/$1/lib/python2.7/site-packages | |
# Ipython installtion | |
ln -s ~/Documents/venv/dev_pack2/bin/i* ~/Documents/venv/$1/bin/ | |
# ln -s ~/Documents/venv/dev_pack2/lib/python2.7/site-packages/IPython ~/Documents/venv/$1/lib/python2.7/site-packages/ | |
# Nosetests installtion | |
ln -s ~/Documents/venv/dev_pack2/bin/nose* ~/Documents/venv/$1/bin/ |
This file contains 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
# Process files in a loop with arbitrary names | |
while IFS= read -r -d '' f; do | |
cp "$f" /path2/ | |
done < <(find /path/ -wholename '*.mp3' -print0) | |
# Find a pattern and replace in place using sed | |
ls /path/*.csv -1 | grep "subj[0-9]_" | sed -n "s/\(.*subj\)\([0-9].*\)/mv \1\2 \10\2/p" | |
# Count the number of files in each sub directory and write to a file | |
find images/ -maxdepth 1 -print0 | xargs -0 -n 1 -I dir sh -c 'printf dir"\t"; find dir/ -name "*.jpg" | wc -l' &> distribution.txt |
This file contains 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
export DEBIAN_FRONTEND=noninteractive | |
sudo apt-get update -q -y | |
sudo apt-get -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install linux-generic | |
wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb | |
sudo apt-get update -q -y | |
sudo apt-get install cuda -q -y | |
echo ' /usr/local/cuda/lib64 | |
/usr/local/cuda/lib' | sudo tee -a /etc/ld.so.conf.d/cuda.conf > /dev/null |
OlderNewer