General walkthrough for caffe on CentOS: http://www.aymeric.net/journal/2015/07/tutorial-install-caffe-on-centos-7/
Make sure that the Python include directories actually exist (these differ subtly from Ubuntu to CentOS).
CUSTOM_CXX := g++
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| from __future__ import unicode_literals | |
| import argparse | |
| import h5py | |
| import json | |
| import os | |
| import scipy.misc |
| #!/usr/bin/env bash | |
| #Check Files in list from file exist or doesn't exist in directory. | |
| if [ $# -eq 0 ] || [ $# -eq 1 ] | |
| then | |
| echo "You must pass the path to file with the list and the path to directory to check files. \nsh check-file-exist-from-list.sh path/to/file path/to/directory" | |
| exit 1 | |
| fi | |
| while read -r file; do |
| ''' | |
| Sometimes it is useful to know the total number of video frames before starting to iterate. | |
| This is not possible using the default video reader in Sk-video. | |
| The snippet below shows how to do this using the FFMPEG reader instead. | |
| ''' | |
| if osp.exists(video_path): | |
| vid_reader = skvideo.io.FFmpegReader(video_path) # NOTE: not the standard skvideo.io.vreader | |
| else: | |
| raise IOError('Path to video not found: \n%s' % video_path) |
General walkthrough for caffe on CentOS: http://www.aymeric.net/journal/2015/07/tutorial-install-caffe-on-centos-7/
Make sure that the Python include directories actually exist (these differ subtly from Ubuntu to CentOS).
CUSTOM_CXX := g++
| ## Refer to http://caffe.berkeleyvision.org/installation.html | |
| # Contributions simplifying and improving our build system are welcome! | |
| # cuDNN acceleration switch (uncomment to build with cuDNN). | |
| USE_CUDNN := 1 | |
| # CPU-only switch (uncomment to build without GPU support). | |
| # CPU_ONLY := 1 | |
| # uncomment to disable IO dependencies and corresponding data layers |
| {0: u'__background__', | |
| 1: u'person', | |
| 2: u'bicycle', | |
| 3: u'car', | |
| 4: u'motorcycle', | |
| 5: u'airplane', | |
| 6: u'bus', | |
| 7: u'train', | |
| 8: u'truck', | |
| 9: u'boat', |
/mnt/nfs/work1/elm/hzjiang/Share/caffe2 to your own work/toolboxes folder. For me this was /home/arunirc/work1/Tools/caffe2/build.export PYTHONPATH=/mnt/nfs/work1/elm/arunirc/Tools/caffe2/build:$PYTHONPATH
export LD_LIBRARY_PATH=/mnt/nfs/work1/elm/arunirc/Tools/caffe2/build/lib:$LD_LIBRARY_PATH
| # A dataset like WIDER-face has folders like: | |
| # 0--Parade 21--Festival 33--Running | |
| # 45--Balloonist 57--Angler 10--People_Marching | |
| # This one-liner splits on '--', takes the second sub-string and gets rid of the '_' | |
| # NOTE: example usage of awk | |
| ls | awk -F'--' '{printf "%s\n", $2}' | awk -F'_' '{printf "%s %s\n", $1, $2}' |
| from __future__ import division | |
| import scipy.optimize | |
| import numpy as np | |
| def bbox_iou(boxA, boxB): | |
| # https://www.pyimagesearch.com/2016/11/07/intersection-over-union-iou-for-object-detection/ | |
| # ^^ corrected. | |
| # Determine the (x, y)-coordinates of the intersection rectangle | |
| xA = max(boxA[0], boxB[0]) |