opencv: Install opencv CentOS


sudo yum install opencv opencv-python opencv-devel-docs 

#OPTIONAL DEPENDENCIES:
sudo yum install -y python-devel gtk2-devel libdc1394-devel libv4l-devel ffmpeg-devel gstreamer-plugins-base-devel
sudo yum install -y libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel libtiff-devel libwebp-devel
sudo yum install -y gcc  cmake  git gtk2-devel pkgconfig  numpy  ffmpeg

If your using virtual environment, copy the relevant cv files to the virtual environment.

 cp /usr/lib64/python2.7/site-packages/cv* .venv/lib/python2.7/site-packages/

Caffe: Visualizing Caffe Network prototxt file using GraphViz: draw_net.py

Visualizing Caffe Net topology/ntwork/prototxt file using GraphViz
From the Caffe root directory, you can generate a graph in image format from a .prototxt model file:

#INSTALL PRE-REQS:
$ make pycaffe
$ pip install pydotplus
$ yum install graphviz

Visualize a CNN in left-to-right:

#goto CAFFE ROOT
$ python/draw_net.py mynetwrk.prototxt mynetwrk.png

Output formats could be : PNG, PDF, DOT or other GraphViz supported formats.
Visualize a CNN in top-to-bottom:

$ python/draw_net.py --rankdir TB mynetwrk.prototxt mynetwrk.png

Following errors can be eliminated if you install the PRE-REQS (pip install pydotplus; yum install graphviz)

pydotplus.graphviz.InvocationException: GraphViz's executables not found
Exception: "dot" not found in path.
ImportError: No module named pydot

Github: Merging two branches


git remote add remote-name remote-github-url 
git fetch remote-name 
git merge remote-name/branch-name 
git status

Github: Update a GitHub forked repository;


git remote add upstream github-URL
git fetch upstream 
git merge upstream/master master 
git pull upstream master 
git push

Python contextlib for Timing Python code

If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...