Skip to content

Commit

Permalink
CVS-46787 update example clients readme (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrawins authored Jan 21, 2021
1 parent d4d7c43 commit a5887f5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 13 deletions.
37 changes: 27 additions & 10 deletions example_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ usage: get_model_status.py [-h] [--grpc_address GRPC_ADDRESS]

```

- Optional Arguments
- Arguments

| Argument | Description |
| :--- | :---- |
Expand Down Expand Up @@ -71,7 +71,7 @@ usage: get_serving_meta.py [-h] [--grpc_address GRPC_ADDRESS]

```

- Optional Arguments
- Arguments

| Argument | Description |
| :--- | :---- |
Expand Down Expand Up @@ -112,10 +112,14 @@ usage: grpc_serving_client.py [-h] --images_numpy_path IMAGES_NUMPY_PATH
[--iterations ITERATIONS]
[--batchsize BATCHSIZE]
[--model_name MODEL_NAME]
[--pipeline_name PIPELINE_NAME]
[--pipeline_name PIPELINE_NAME]
[--tls]
[--server_cert SERVER_CERT]
[--client_cert CLIENT_CERT]
[--client_key CLIENT_KEY]
```

- Optional Arguments
- Arguments

| Argument | Description |
| :--- | :---- |
Expand All @@ -132,6 +136,10 @@ usage: grpc_serving_client.py [-h] --images_numpy_path IMAGES_NUMPY_PATH
| --batchsize | Number of images in a single request. Default: 1 |
| --model_name | Define model name, must be same as is in service. Default: resnet|
| --pipeline_name | Define pipeline name, must be same as is in service |
| --tls | enables TLS communication with gRPC endpoint |
| --server_cert SERVER_CERT | Path to the server certificate, used only with TLS communication |
| --client_cert CLIENT_CERT | Path to the client certificate, used only with TLS communication |
| --client_key CLIENT_KEY | Path to the client key, used only with TLS communication |


- Usage example
Expand Down Expand Up @@ -199,9 +207,10 @@ usage: jpeg_classification.py [-h] [--images_list IMAGES_LIST]
[--input_name INPUT_NAME]
[--output_name OUTPUT_NAME]
[--model_name MODEL_NAME] [--size SIZE]
[--rgb_image RGB_IMAGE]
```

- Optional Argument
- Arguments

| Argument | Description |
| :--- | :---- |
Expand All @@ -213,7 +222,7 @@ usage: jpeg_classification.py [-h] [--images_list IMAGES_LIST]
| --output_name | Specify output name. Default: resnet_v1_50/predictions/Reshape_1 |
| --model_name | Define model name, must be same as is in service. Default: resnet|
| --size SIZE | The size of the image in the model|

| --rgb_image RGB_IMAGE | Convert BGR channels to RGB channels in the input image |

- Usage example

Expand Down Expand Up @@ -274,7 +283,7 @@ to install and run them (provided for Linux OS):
python multi_inputs.py --help
```

- Optional Arguments
- Arguments

| Argument | Description |
| :--- | :---- |
Expand Down Expand Up @@ -341,7 +350,7 @@ usage: rest_get_model_status.py [-h] [--rest_url REST_URL]
[--model_name MODEL_NAME]
[--model_version MODEL_VERSION]
```
- Optional arguements
- Arguments

| Argument | Description |
| :--- | :---- |
Expand Down Expand Up @@ -376,7 +385,7 @@ usage: get_serving_meta.py [-h] [--grpc_address GRPC_ADDRESS]
[--grpc_port GRPC_PORT] [--model_name MODEL_NAME]
[--model_version MODEL_VERSION]
```
- Optional arguements
- Arguments

| Argument | Description |
| :--- | :---- |
Expand Down Expand Up @@ -471,9 +480,13 @@ usage: rest_serving_client.py [-h] --images_numpy_path IMAGES_NUMPY_PATH
[--model_name MODEL_NAME]
[--request_format {row_noname,row_name,column_noname,column_name}]
[--model_version MODEL_VERSION]
[--client_cert CLIENT_CERT]
[--client_key CLIENT_KEY]
[--ignore_server_verification]
[--server_cert SERVER_CERT]
```

- Optional Arguments :
- Arguments :

| Argument | Description |
| :--- | :---- |
Expand All @@ -491,6 +504,10 @@ usage: rest_serving_client.py [-h] --images_numpy_path IMAGES_NUMPY_PATH
| --model_name MODEL_NAME| Define model name, must be same as is in service. Default: resnet|
| --request_format {row_noname,row_name,column_noname,column_name}| Request format according to TF Serving API:row_noname,row_name,column_noname,column_name|
| --model_version MODEL_VERSION| Model version to be used. Default: LATEST |
| --client_cert CLIENT_CERT | Specify mTLS client certificate file. Default: None |
| --client_key CLIENT_KEY | Specify mTLS client key file. Default: None |
| --ignore_server_verification | Skip TLS host verification. Do not use in production. Default: False |
| --server_cert SERVER_CERT | Path to a custom directory containing trusted CA certificates, server certificate, or a CA_BUNDLE file. Default: None, will use default system CA cert store |

- Usage Example
```bash
Expand Down
16 changes: 14 additions & 2 deletions example_client/face_detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ usage: face_detection.py [-h] [--input_images_dir INPUT_IMAGES_DIR]
[--output_dir OUTPUT_DIR] [--batch_size BATCH_SIZE]
[--width WIDTH] [--height HEIGHT]
[--grpc_address GRPC_ADDRESS] [--grpc_port GRPC_PORT]
[--model_name MODEL_NAME] [--tls]
[--server_cert SERVER_CERT]
[--client_cert CLIENT_CERT] [--client_key CLIENT_KEY]

Demo for face detection requests via TFS gRPC API.analyses input images and
saves with with detected faces.it relies on model face_detection...

optional arguments:
Arguments:
-h, --help show this help message and exit
--input_images_dir INPUT_IMAGES_DIR
Directory with input images
--output_dir OUTPUT_DIR
Directory for staring images with detection results
Directory for storing images with detection results
--batch_size BATCH_SIZE
how many images should be grouped in one batch
--width WIDTH how the input image width should be resized in pixels
Expand All @@ -34,6 +37,15 @@ optional arguments:
Specify url to grpc service. default:localhost
--grpc_port GRPC_PORT
Specify port to grpc service. default: 9000
--model_name MODEL_NAME
Specify the model name
--tls use TLS communication with gRPC endpoint
--server_cert SERVER_CERT
Path to server certificate
--client_cert CLIENT_CERT
Path to client certificate
--client_key CLIENT_KEY
Path to client key
```

## Usage example
Expand Down
2 changes: 1 addition & 1 deletion example_client/face_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def load_image(file_path):
'it relies on model face_detection...')

parser.add_argument('--input_images_dir', required=False, help='Directory with input images', default="images/people")
parser.add_argument('--output_dir', required=False, help='Directory for staring images with detection results', default="results")
parser.add_argument('--output_dir', required=False, help='Directory for storing images with detection results', default="results")
parser.add_argument('--batch_size', required=False, help='How many images should be grouped in one batch', default=1, type=int)
parser.add_argument('--width', required=False, help='How the input image width should be resized in pixels', default=1200, type=int)
parser.add_argument('--height', required=False, help='How the input image width should be resized in pixels', default=800, type=int)
Expand Down

0 comments on commit a5887f5

Please sign in to comment.