Awesome
Update
- 2020-03-29 Add
caffemodel2txt.cpp
- 2020-03-28 Add some new layers,
permute
( fromssd) andUpsample
(nearest
andbilinear
,only forward) based on origin caffe. Source is:
include/caffe/layers/permute_layer.hpp
src/caffe/layers/permute_layer.cpp
src/caffe/layers/permute_layer.cu
include/caffe/layers/upsample_layer.hpp
src/caffe/layers/upsample_layer.cpp
src/caffe/layers/upsample_layer.cu
Example
Caffemodle2txt layer
- Convert a caffemodel to txt or txt to caffemodel
Usage:
./build/tools/caffemodel2txt c2t[t2c] caffemodel_path[txt_path] txt_path[caffemodel_path]
Upsample layer
- Upsample shape of bottom[0] to shape of bottom[1]
layer{
name:"Upsample_nearest"
type:"Upsample"
bottom:"Conv2d_87" #Blob Conv2d_87's shape is [1,16,32,32]
bottom:"Conv2d_84" #Blob Conv2d_84's shape is [1,16,48,48]
top:"Upsample_nearest" #Blob Upsample_nearest's shape is [1,16,48,48]
upsample_param{
mode: NEAREST # or BILINEAR
}
}
- Upsample shape of bottom to
HEIGHT
andWIDTH
layer{
name:"Upsample_nearest"
type:"Upsample"
bottom:"Conv2d_87" #Blob Conv2d_87's shape is [1,16,32,32]
top:"Upsample_nearest" #Blob Upsample_nearest's shape is [1,16,HEIGHT,WIDTH]
upsample_param{
mode: NEAREST # or BILINEAR
height: HEIGHT
width: WIDTH
}
}
- Upsample shape of bottom to
HEIGHT_SCALE
xbottom_height
andWIDTH_SCALE
xbottom_width
layer{
name:"Upsample_nearest"
type:"Upsample"
bottom:"Conv2d_87" #Blob Conv2d_87's shape is [1,16,32,32]
top:"Upsample_nearest" #Blob Upsample_nearest's shape is [1,16,32*HEIGHT_SCALE,32*WIDTH_SCALE]
upsample_param{
mode: NEAREST # or BILINEAR
height_scale: HEIGHT_SCALE
width_scale: WIDTH_SCALE
}
}
- A face detection example using above upsample seePytorch_Retinaface_To_Caffe
Caffe
Caffe is a deep learning framework made with expression, speed, and modularity in mind. It is developed by Berkeley AI Research (BAIR)/The Berkeley Vision and Learning Center (BVLC) and community contributors.
Check out the project site for all the details like
- DIY Deep Learning for Vision with Caffe
- Tutorial Documentation
- BAIR reference models and the community model zoo
- Installation instructions
and step-by-step examples.
Custom distributions
- Intel Caffe (Optimized for CPU and support for multi-node), in particular IntelĀ® Xeon processors.
- OpenCL Caffe e.g. for AMD or Intel devices.
- Windows Caffe
Community
Please join the caffe-users group or gitter chat to ask questions and talk about methods and models. Framework development discussions and thorough bug reports are collected on Issues.
Happy brewing!
License and Citation
Caffe is released under the BSD 2-Clause license. The BAIR/BVLC reference models are released for unrestricted use.
Please cite Caffe in your publications if it helps your research:
@article{jia2014caffe,
Author = {Jia, Yangqing and Shelhamer, Evan and Donahue, Jeff and Karayev, Sergey and Long, Jonathan and Girshick, Ross and Guadarrama, Sergio and Darrell, Trevor},
Journal = {arXiv preprint arXiv:1408.5093},
Title = {Caffe: Convolutional Architecture for Fast Feature Embedding},
Year = {2014}
}