README.md 1.1 KB
Newer Older
J
Jiawei Wang 已提交
1 2 3 4 5 6 7 8 9 10
## Image Classification

([简体中文](./README_CN.md)|English)

The example uses the ResNet50_vd model to perform the imagenet 1000 classification task.

### Get model config and sample dataset
```
sh get_model.sh
```
M
MRXLT 已提交
11 12 13 14 15 16 17

### Install preprocess module

```
pip install paddle_serving_app
```

J
Jiawei Wang 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
### HTTP Infer

launch server side
```
python image_classification_service.py ResNet50_vd_model workdir 9393 #cpu inference service
```
```
python image_classification_service_gpu.py ResNet50_vd_model workdir 9393 #gpu inference service
```


client send inference request
```
python image_http_client.py
```
### RPC Infer

launch server side
```
python -m paddle_serving_server.serve --model ResNet50_vd_model --port 9393 #cpu inference service
```

```
python -m paddle_serving_server_gpu.serve --model ResNet50_vd_model --port 9393 --gpu_ids 0 #gpu inference service
```

client send inference request
```
python image_rpc_client.py ResNet50_vd_client_config/serving_client_conf.prototxt
```
*the port of server side in this example is 9393, the sample data used by client side is in the folder ./data. These parameter can be modified in practice*