order = scores.argsort() order = scores.argsort()[::-1]
transpose
1
im = im[:, :, (2, 1, 0)]
copy=true
1
im_orig = im.astype(np.float32, copy=True)
resize
1
im = cv2.resize(im_orig, None, None, fx=im_scale, fy=im_scale,interpolation=cv2.INTER_LINEAR)
每一个维度取最大
1
max_shape = np.array([im.shape for im in ims]).max(axis=0) # 每一位取最大的
os.path.join
solvers = [[net_name, n, ‘stage1_rpn_solver60k80k.pt’], [net_name, n, ‘stage1_fast_rcnn_solver30k40k.pt’]] solvers = [os.path.join(cfg.MODELS_DIR, *s) for s in solvers]
随机数
1 2 3
# fix the random seeds (numpy and caffe) for reproducibility np.random.seed(cfg.RNG_SEED) caffe.set_random_seed(cfg.RNG_SEED)
split
1 2 3
for year in ['2007', '2012']: for split in ['train', 'val', 'trainval', 'test']: name = 'voc_{}_{}'.format(year, split)
set -x 输出执行的命令 set -e 错误就停止 ${foo,} lowercase the first letter ${foo,,} lowercase all the letters ${foo^^} uppercase all the letters ${string/regexp/replacement} `date +'%Y-%m-%d_%H-%M-%S'` time
cd$FRCN_ROOT/caffe-fast-rcnn # Now follow the Caffe installation instructions here: # http://caffe.berkeleyvision.org/installation.html
# If you're experienced with Caffe and have all of the requirements installed # and your Makefile.config in place, then simply do: make -j8 && make pycaffe
# update source code using v3 of cudnn sed -i 's/cudnnConvolutionBackwardData_v3/cudnnConvolutionBackwardData/g'$CAFFE_FAST_RCNN/src/caffe/layers/cudnn_conv_layer.cu sed -i 's/cudnnConvolutionBackwardFilter_v3/cudnnConvolutionBackwardFilter/g'$CAFFE_FAST_RCNN/src/caffe/layers/cudnn_conv_layer.cu