Skip to content

Instantly share code, notes, and snippets.

@abhinavgupta
abhinavgupta / opencv_install
Created March 10, 2013 09:04
Shell script to install OpenCV 2.3 on your debian machine
echo "Installing OpenCV 2.4.2"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get remove remove ffmpeg x264 libx264-dev
echo "Installing Dependenices"
sudo apt-get install libopencv-dev
sudo apt-get install build-essential checkinstall cmake pkg-config yasm
sudo apt-get install libtiff4-dev libjpeg-dev libjasper-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev
@abhinavgupta
abhinavgupta / opencv_install
Created March 10, 2013 09:02
Shell script to install OpenCV 2.3 on your debian machine
arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
flag=1
else
flag=0
fi
echo "Installing OpenCV 2.4.3"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
@abhinavgupta
abhinavgupta / opencv_install.sh
Created March 10, 2013 09:01
Shell script to install OpenCV 2.3 on your debian machine
arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
flag=1
else
flag=0
fi
echo "Installing OpenCV 2.4.3"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
@abhinavgupta
abhinavgupta / opencv_install.sh
Created March 10, 2013 09:01
Shell script to install OpenCV 2.3 on your debian machine
arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
flag=1
else
flag=0
fi
echo "Installing OpenCV 2.4.3"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
@abhinavgupta
abhinavgupta / opencv_install.sh
Created March 10, 2013 09:01
Shell script to install OpenCV 2.3 on your debian machine
arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
flag=1
else
flag=0
fi
echo "Installing OpenCV 2.4.3"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
@abhinavgupta
abhinavgupta / opencv_install.sh
Created March 10, 2013 09:01
Shell script to install OpenCV 2.3 on your debian machine
arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
flag=1
else
flag=0
fi
echo "Installing OpenCV 2.4.3"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
@abhinavgupta
abhinavgupta / opencv_install.sh
Created March 10, 2013 09:01
Shell script to install OpenCV 2.3 on your debian machine
arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
flag=1
else
flag=0
fi
echo "Installing OpenCV 2.4.3"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
@abhinavgupta
abhinavgupta / opencv_install.sh
Created March 10, 2013 09:01
Shell script to install OpenCV 2.3 on your debian machine
arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
flag=1
else
flag=0
fi
echo "Installing OpenCV 2.4.3"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
@abhinavgupta
abhinavgupta / TextRank.py
Created October 16, 2012 17:25
PageRank for text summarization
import networkx as nx
import numpy as np
from nltk.tokenize.punkt import PunktSentenceTokenizer
from sklearn.feature_extraction.text import TfidfTransformer, CountVectorizer
def textrank(document):
sentence_tokenizer = PunktSentenceTokenizer()
sentences = sentence_tokenizer.tokenize(document)
@abhinavgupta
abhinavgupta / fetch_url.py
Created October 16, 2012 13:44
Simple script for faster fetching with urllib2 with exception handling
import threading, urllib2
import Queue
def read_url(url, queue):
try:
data = urllib2.urlopen(url).read()
except urllib2.HTTPError, e:
checksLogger.error('HTTPError = ' + str(e.code))
except urllib2.URLError, e:
checksLogger.error('URLError = ' + str(e.reason))