Total Pageviews

Monday 11 July 2016

图像识别系统-Huabot Brain

An Image Recognition System build on top of caffe deep learning framework.

Quick start

Please make sure install the requirements.

install

go get -v github.com/Lupino/huabot-brain

start server

cd $GOPATH/src/github.com/Lupino/huabot-brain
make deps
make # precompile and package javascript
huabot-brain

load datasets

cd $GOPATH/src/github.com/Lupino/huabot-brain/tools/datasets
python get_datasets.py

open dashboard

Just click Solve button to solve the network.

learn more

see API.md

Requirements

from https://github.com/Lupino/huabot-brain/
---------------

Huabot Brain 一个简单易用的图片识别系统

关于 Huabot Brain

Huabot Brain 可以说是 caffe 的 GUI 工具。 Huabot Brain 提供 restful api 和一个基于 react 的 web 页面,使得开发者或者研究人员可以 方便的使用 caffe,查看训练状态,提供 demo 和应用。 可作为一个嵌入式的子系统,通过简单的 restful api 给原有的系统提供深度学习的能力。

安装 Huabot Brain


# 设置 GOPATH
export GOPATH=$HOME/gopath
export PATH=$GOPATH/bin:$PATH

# 安装 Huabot Brain
go get -v github.com/Lupino/huabot-brain
# 安装 Train worker
go get -v github.com/Lupino/huabot-brain/tools/train_worker

启动 Huabot Brain


# 启动 Gearman job server
gearmand -d

# 启动 Huabot Brain (默认端口 3000)
cd $GOPATH/src/github.com/Lupino/huabot-brain
huabot-brain --gearmand=127.0.0.1:4730 --dbpath=dataset.db

# 启动 Train worker
train_worker --gearmand=127.0.0.1:4730

# 启动 Predict Worker (这一步要等训练一端时间或完成后,才可执行, xxx 为数字)
ln -s resourses/models/huabot-brain_iter_xxx.caffemodel resourses/models/huabot-brain.caffemodel
env GEARMAND_PORT=tcp://127.0.0.1:4730 python tools/predict_worker/main.py resources

提交数据


# 用 curl 提交数据
curl -XPOST -F file=@/path/to/image.png -F tag=xxx -F data_type=1 http://127.0.0.1:3000/api/datasets

# 用脚本提交数据
cd tools/datasets
python get_datasets.py

自己的数据集请使用 API 提交

训练 Huabot Brain

打开 Dashboard 点击 Train 就可以了。 也可以用命令

curl http://127.0.0.1:3000/api/train

详细信息请见 API 文档

预测图片的信息

但这里需要启动 predict worker。
通过 DEMO 页面,在这里面贴入一个图片的地址,回车就可以。
也可以用 API:

curl -d img_url=http://image http://127.0.0.1:3000/api/predict

结束语

就此饱览了 Huabot Brain 的盛宴。
from http://lupino.github.io/2015/03/05/huabot-brain.html