# Keras-ImageNet
基于Keras预训练模型VGG16、ResNet50、InceptionV3,使用Python的HTTP框架Flask搭建图像识别接口。
> * Download from Baidu Netdisk
VGG16、ResNet50、InceptionV3
downloaded: http://pan.baidu.com/s/1geHmOpH
details: http://keras-cn.readthedocs.io/en/latest/other/application/
> * Move to ~/.keras/models folder
①imagenet_class_index.json 30+K
②vgg16_weights_tf_dim_ordering_tf_kernels.h5 527+M
③resnet50_weights_tf_dim_ordering_tf_kernels.h5 98+M
④inception_v3_weights_tf_dim_ordering_tf_kernels.h5 91+M
> * Run by Flask Http Framework
`python run.py` # local test
`nohub python run.py &` # remote deploy
note :
debug must be False
if equals True, ValueError: Tensor:(…) is not an element of this graph
```
if __name__ == '__main__':
app.run('0.0.0.0', debug=False) # note : must be False
```
> * Request
```
file 图片 type(file)
top 标签数量 type(integer)
network 网络 select(vgg/res/inc)
language 语言 select(cn/en)
```
> * Response
```
{
"result": 0, # 0 success 1 error
"tags": [
{
"tag_confidence": 0.982,
"tag_name": "老虎"
},
{
"tag_confidence": 0.018,
"tag_name": "山猫,虎猫"
}
]
}
```
```
# For VGG16 curl
curl "127.0.0.1:5000/api" -F"top=5" -F"net=vgg" -F"lang=cn" -F"file=@tiger.jpg"
# For RestNet50 curl
curl "127.0.0.1:5000/api" -F"top=5" -F"net=res" -F"lang=cn" -F"file=@tiger.jpg"
# For InceptionV3 curl
curl "127.0.0.1:5000/api" -F"top=5" -F"net=inc" -F"lang=cn" -F"file=@tiger.jpg"
# For Http Java
see ImageNet.java for more details.
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
毕设&课程作业_基于Keras预训练模型VGG16等,使用Python的HTTP框架Flask搭建图像识别接口.zip (9个子文件)
Graduation Design
core
utils.py 961B
__init__.py 250B
network.py 1006B
imagenet_cn.txt 22KB
server.py 2KB
run.py 120B
java-test
pom.xml 1KB
ImageNet.java 2KB
README.md 2KB
共 9 条
- 1
资源评论
学术菜鸟小晨
- 粉丝: 1w+
- 资源: 4928
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功