[关闭]
@cleardusk 2016-03-06T14:46:16.000000Z 字数 2918 阅读 1346

3.2

GjzCV


数据库

http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html

training/validation/test

上述的数据库将所有数据分为了三个部分,查了下区别:http://stats.stackexchange.com/questions/19048/what-is-the-difference-between-test-set-and-validation-set

大意就是 validation data 的用处就是用于挑选不同的模型以及调参。test data 是用来分析的

CelebA 数据库 1-162770: train, 162771-182637: validation, 182637-202599: test。大致比例为 80/10/10。

hack mnist dataset

http://yann.lecun.com/exdb/mnist/ 里面说明的 mnist 的数据格式

caffe 源码简单的分析:
http://chenrudan.github.io/blog/2015/05/07/cafferead.html

gflags

命令行参数解析的 c++ 库,给一个 demo:

  1. #include <iostream>
  2. #include <gflags/gflags.h>
  3. using namespace std;
  4. DEFINE_string(debug, "hello", "Just for test");
  5. int main(int argc, char** argv) {
  6. google::ParseCommandLineFlags(&argc, &argv, true);
  7. printf("%s\n", FLAGS_debug.c_str());
  8. return 0;
  9. }

Makefile 文件:

  1. CXX = g++
  2. CXX_FLAG = -std=c++11
  3. # CXX_FLAG = -std=c++0x #this is right, too
  4. OUTPUT = demo
  5. LIB_PATH = "/usr/lib/x86_64-linux-gnu/"
  6. LIB_NAME = gflags
  7. default:
  8. ${CXX} main.cpp ${CXX_FLAG} -o ${OUTPUT} -L${LIB_PATH} -l${LIB_NAME}
  9. clean:
  10. rm -rf ${OUTPUT}

值得一提的是,gflags 库的搜索路径是用 Synaptic 查看的。用 linux 命令查看的话还不清楚。查看的时候发现有这个:/usr/lib/x86_64-linux-gnu/pkgconfig/libglog.pc。有了这个就可以借助 pkg-config 来查看了。

  1. pkg-config --cflags --libs libgflags

Makefile 可以改写成这样,其中用到了 shell。--cflags 多输出了个空格,更标准的参数格式。

  1. CXX = g++
  2. CXX_FLAG = -std=c++11
  3. OUTPUT = demo
  4. LIB_FLAG := $(shell pkg-config --cflags --libs libgflags)
  5. default:
  6. ${CXX} main.cpp ${CXX_FLAG} -o ${OUTPUT} ${LIB_FLAG}
  7. clean:
  8. rm -rf ${OUTPUT}

glog 的 demo:

  1. #include <iostream>
  2. #include <glog/logging.h>
  3. int main(int argc, char* argv[]){
  4. google::InitGoogleLogging(argv[0]); # 加了此行,默认输出到 /tmp/程序名.log
  5. LOG(INFO) << "Hello, GLOG";
  6. }

glog 还可以跟 gflags 合用~

protobuf

先写 proto 文件,然后用 protoc 生成 *.pb.h 和 *.pb.c 文件。在代码中包含 *.pb.h 头文件就可以使用了,大致是这样,但并未成功,有时间再参考一下官方文档:https://developers.google.com/protocol-buffers/docs/cpptutorial

protoc 基本使用

  1. protoc --cpp_out=. *.proto
  1. pkg-config --libs protobuf

可以查看链接选项。

以上三个源码目录都在 /home/gjz/GjzWorkspace/C++/convert_mnist_data/ 中!

LMDB

这几个是借助现成工具或者 Python 实现的:
http://research.beenfrog.com/code/2015/12/30/write-read-lmdb-example.html
http://www.cnblogs.com/dupuleng/articles/4370236.html
http://www.cnblogs.com/denny402/p/5082341.html

caffe 关键点定位:
https://www.zhihu.com/question/37351143
https://github.com/olddocks/caffe-facialkp
http://corpocrat.com/2015/02/24/facial-keypoints-extraction-using-deep-learning-with-caffe/
http://danielnouri.org/notes/2014/12/17/using-convolutional-neural-nets-to-detect-facial-keypoints-tutorial/
http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1EuclideanLossLayer.html#details
https://github.com/dirtysalt/tomb/blob/master/kaggle/facial-keypoints-detection/tst.py
google group 的一个讨论:https://groups.google.com/forum/#!topic/caffe-users/ZfntAyJsdY4

CNN Facepoints
http://mmlab.ie.cuhk.edu.hk/archive/CNN_FacePoint.htm

http://chenrudan.github.io/blog/2015/05/07/cafferead.html
http://yann.lecun.com/exdb/mnist/
http://deepdish.io/2015/04/28/creating-lmdb-in-python/
http://caffe.berkeleyvision.org/tutorial/
http://www.cnblogs.com/yymn/p/4479216.html

参考

glog 博客:http://www.cnblogs.com/tianyajuanke/archive/2013/02/22/2921850.html

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注