thiagocleonel / datadrivenvision_samplecode Goto Github PK
View Code? Open in Web Editor NEWThis project forked from genp/datadrivenvision_samplecode
sample code for CS2951-t Data Driven Vision
This project forked from genp/datadrivenvision_samplecode
sample code for CS2951-t Data Driven Vision
### This is an example of how to use a pretrained model to extract CNN features from images. To begin this process, please download and install caffe, along with the typical python libraries numpy, sklearn, and scipy. I recommend using virtualenv to manage the python environment. Once caffe is installed, download the pretrained model you would like to use. In this example I will use the HybridCNN model introduced in the Places dataset paper. ### # model setup - this will have different names depending on the model you download. It could be deploy.prototxt or solver.prototxt MODEL_FILE = '/home/gen/caffe/models/hybridCNN/hybridCNN_deploy_FC7.prototxt' # pretrained network weights - this file will be called somthing.caffemodel PRETRAINED = '/home/gen/caffe/models/hybridCNN/hybridCNN_iter_700000.caffemodel' ### To extract features for images, use the sample code in create_features.py. Below is an example of command line execution to extract the HybridCNN fc7 layer feature for one test image. The command line arguments for create_features.py allow the user to pass several images in for feature calculation. This may be desirable as loading the caffe network is usually the time consuming aspect. create_features.py contains an option on line 102 to use or not use the gpu. Executing this script for many files serially on a gpu is probably the fastest way to use it. You may also choose to use the Brown CS compute grid to parallelize feature extraction over hundreds of CPUs. Please ask about grid usage best practices if you have never used the grid before. You are also encouraged to alter this code to extract features in a sliding window fashion or from a pre-determined region of interest. Note that this will be much slower than training a caffe network to identify regions of interest, however it might be more straightforward from a coding standpoint. ### ~/DataDrivenVision_SampleCode $ ./create_features.py -i ~/scratch/test.png --feat_type hybridCNN --model_file /home/gen/caffe/models/hybridCNN/hybridCNN_deploy_FC7.prototxt --pretrained /home/gen/caffe/m odels/hybridCNN/hybridCNN_iter_700000.caffemodel --layer_name fc7 --save_dir ~/scratch
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.