Home

测试下CloudSight的图像识别

偶然看到这个链接,一个识别图像并标注的,还蛮有意思。代码直接用示例里面的就可以, 需要注意两个问题: 注册一个项目。ResponseType选择Product。 必须上传网络链接,不能使用文件。 测试几个效果(多次返回结果不一定一样): 百度首页,识别为”百度标志” 陈吉宁校长的头像,识别为”男人的黑色西装外套” 或 “男人的蓝色西装” 我博客一张背景图,识别为”女性的黑色T恤” 或 “红色的通勤自行车” 让我突然对这个tag算法很感兴趣。

Read more

mac下ffmpeg的编译

基本步骤可以看这个,说两个问题: brew的formulae没有celt这个包。忽略了算了。 libaacplus安装的时候, 首先这个地址http://217.20.164.161/~tipok/aacplus/libaacplus-2.0.2.tar.gz已经失效了,从网上下载的话,这个版本还是有问题,configure的时候会卡住,一些patch丢失了好像。建议直接fork github上的。 这个branch也有问题,frontend链接的时候会提示ld: symbol(s) not found for architecture x86_64,直接从Makefile.am里面把frontend去掉算了。 ...

Read more

django mod_wsgi配置的一些问题

安装apache不说了,用apache做django容器的时候(详见参考文献1)遇到如下几个问题,记录一下: apxs找不到。centos上直接装的httpd-2.2.3-83.el5_10,默认没有apxs。想源码编译一个apache,结果发现源里面有。 yum install -y httpd-devel /usr/local/lib/libpython2.7.a: could not read symbols: Bad value 错误提示里面已经说了,libpython2.7.a没有动态编译。下了一个python2.7的源码,重新编译安装一下。 ./configure –prefix=/usr/local/ –enabl...

Read more

gtest在mac上链接的问题

gtest鉴于google自己的风格,不提供make install,直接make完之后配置路径链接就行,在linux上这样是ok的: g++ -I$GTEST_DIR/include -I$GTEST_DIR -c $GTEST_DIR/src/gtest-all.cc g++ -I$GTEST_DIR/include -I$GTEST_DIR -c $GTEST_DIR/src/gtest_main.cc ar -rv libgtest.a gtest-all.o ar -rv libgtest_main.a gtest_main.o c++ -g -Wall -Wextra -pthread -isystem $GTEST_DIR/include -c -o R...

Read more

区分下shell和makefile中的特殊字符

主要是在Makefile中看到了这种字符($@),不理解含义,查阅了一下,跟shell中意义不一样: $@ -is the name of the target currently being processed. $< -is the name of the first dependency. 顺便提下shell下的 $# Stores the number of command-line arguments that were passed to the shell program. $? Stores the exit value of the last command that was executed. $0 Sto...

Read more

gcc命令行参数总结

总结一下混乱的GCC命令行参数,帮助写Makefile: 编译阶段 预编译E->生成汇编S(ccl)->生成机器码c(as)->链接生成目标程序(ld) 输出类型: -E 只执行到预编译 -S 只执行到汇编阶段。生成汇编代码。 -c 只执行到编译。输出目标文件。 空。生成链接目标代码。 -o 指定输出文件名。 输入类型: 每个阶段可以接受之前阶段的中间结果(可跨越)。比如: gcc -E hello.c -o hello.i gcc -S hel...

Read more

Python Configuration Inheritance

While refactoring a project, I met with a situation that one configuration extends another configuration, like this: ConfigA = {"a":xx, "b":xx} ConfigB extends ConfigA + {"a":yy, c:"yy"} Code before refactor treats configA and configB separately. So after a few code iterations you will find configA has something same with configB. So I change...

Read more

About random shuffle in cplusplus

Actually I just want to memorize the usage of STL function random_shuffle. It takes two or threes arguments, the begin iterator, end iterator and a generator. What makes it interesting is the optional third parameter. Random_shuffle will pass the index to generator and takes the output as index to place current element while shuffling. Here is a...

Read more