name: CaffeNet fine-tuned on the Oxford 102 category flower dataset
caffemodel: oxford102.caffemodel
caffemodel_url: https://s3.amazonaws.com/jgoode/oxford102.caffemodel
gist_id: 0179e52305ca768a601f
license: non-commercial
| #!/bin/sh | |
| # Fresh install for CUDA 6.5 on Jetson TK1 for Linux for Tegra (L4T) 21.1 | |
| # CUDA 6.5 REQUIRES L4T 21.1 !!! | |
| sudo apt-add-repository universe | |
| sudo apt-get update | |
| # This is for L4T r21.1 ; Update for your L4T i.e. r21.3 | |
| wget http://developer.download.nvidia.com/compute/cuda/6_5/rel/installers/cuda-repo-l4t-r21.1-6-5-prod_6.5-14_armhf.deb | |
| # Install the CUDA repo metadata that you downloaded | |
| # This is for L4T 21.1 ; Update for your L4T i.e. 21.3 |
| import caffe | |
| import numpy as np | |
| # http://stackoverflow.com/questions/33828582/vgg-face-descriptor-in-python-with-caffe | |
| img = caffe.io.load_image( "ak.png" ) | |
| img = img[:,:,::-1]*255.0 # convert RGB->BGR | |
| avg = np.array([129.1863,104.7624,93.5940]) | |
| img = img - avg # subtract mean (numpy takes care of dimensions :) | |
| img = img.transpose((2,0,1)) | |
| img = img[None,:] # add singleton dimension | |
| net = caffe.Net("VGG_FACE_deploy.prototxt","VGG_FACE.caffemodel", caffe.TEST) |
| import numpy as np | |
| import deepdish as dd | |
| import lmdb | |
| import caffe | |
| import glob | |
| import random | |
| import tifffile | |
| #creates a numpy array data | |
| fdata = glob.glob("/data/*.tif") |
| #include <cuda_runtime.h> | |
| #include <cstring> | |
| #include <cstdlib> | |
| #include <vector> | |
| #include <string> | |
| #include <iostream> | |
| #include <stdio.h> | |
| #include "caffe/caffe.hpp" |
| cmake中一些预定义变量 | |
| PROJECT_SOURCE_DIR 工程的根目录 | |
| PROJECT_BINARY_DIR 运行cmake命令的目录,通常是${PROJECT_SOURCE_DIR}/build | |
| CMAKE_INCLUDE_PATH 环境变量,非cmake变量 | |
| CMAKE_LIBRARY_PATH 环境变量 | |
| CMAKE_CURRENT_SOURCE_DIR 当前处理的CMakeLists.txt所在的路径 | |
| CMAKE_CURRENT_BINARY_DIR target编译目录 使用ADD_SURDIRECTORY(src bin)可以更改此变量的值 SET(EXECUTABLE_OUTPUT_PATH <新路径>)并不会对此变量有影响,只是改变了最终目标文件的存储路径 | |
| CMAKE_CURRENT_LIST_FILE 输出调用这个变量的CMakeLists.txt的完整路径 | |
| CMAKE_CURRENT_LIST_LINE 输出这个变量所在的行 |
| name: "GoogleNet" | |
| input: "data" | |
| input_dim: 10 | |
| input_dim: 3 | |
| input_dim: 224 | |
| input_dim: 224 | |
| # hierarchy 1 | |
| # conv -> relu -> pool -> lrn |
name: CaffeNet fine-tuned on the Oxford 102 category flower dataset
caffemodel: oxford102.caffemodel
caffemodel_url: https://s3.amazonaws.com/jgoode/oxford102.caffemodel
gist_id: 0179e52305ca768a601f
license: non-commercial
| # CMAKE FILE to separatly compile cuda and c++ files | |
| # with the c++11 standard | |
| # | |
| # | |
| # Folder structure: | |
| # | |
| # | | |
| # +--main.cpp (with C++11 content) | |
| # +--include/ | |
| # | | |
(Codecs are extracted from https://web.archive.org/web/20120722124832/http://opencv.willowgarage.com/wiki/QuickTimeCodecs )
| import cv2 | |
| import numpy as np | |
| def in_front_of_both_cameras(first_points, second_points, rot, trans): | |
| # check if the point correspondences are in front of both images | |
| rot_inv = rot | |
| for first, second in zip(first_points, second_points): | |
| first_z = np.dot(rot[0, :] - second[0]*rot[2, :], trans) / np.dot(rot[0, :] - second[0]*rot[2, :], second) | |
| first_3d_point = np.array([first[0] * first_z, second[0] * first_z, first_z]) |