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
{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', |
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
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]) |
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
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008 | |
Compiled by Eric Pement - eric [at] pement.org version 0.27 | |
Latest version of this file (in English) is usually at: | |
http://www.pement.org/awk/awk1line.txt | |
This file will also be available in other languages: | |
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt | |
USAGE: |
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
#!/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 |
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
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 |
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
# saliency | |
sal = cluster_saliency[cluster_label] # [ (grad-norm, grad-max) | |
grad_max = sal[1] / max(sal[1]) | |
feat_vertices = features[cluster_ids, :] | |
adj_mat = get_adjmat(feat_vertices, is_norm_adj=False) | |
adj_mat_normed = get_adjmat(feat_vertices, is_norm_adj=True) | |
# create networkx graph from adjacency matrix |
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
''' | |
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) |
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 PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\n\$ " | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
# User defined aliases | |
alias ls='ls -GFh' | |
# Mounting remote drives (create folder manually first under ~/Mount/remote-name) | |
alias mount-fisher='sshfs arunirc@fisher.cs.umass.edu:/ ~/Mount/fisher -o volname=fisher' |
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
import os | |
import sys | |
import pickle | |
import json | |
import numpy as np | |
import sys | |
import matplotlib | |
matplotlib.use('Agg') | |
from matplotlib import pyplot as plt | |
import os.path as osp |
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
force_color_prompt=yes | |
if [ -n "$force_color_prompt" ]; then | |
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
# We have color support; assume it's compliant with Ecma-48 | |
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such | |
# a case would tend to support setf rather than setaf.) | |
color_prompt=yes | |
else | |
color_prompt=yes=no |
NewerOlder