Skip to content

Commit a5887f5

Browse files
authored
CVS-46787 update example clients readme (#467)
1 parent d4d7c43 commit a5887f5

File tree

3 files changed

+42
-13
lines changed

3 files changed

+42
-13
lines changed

example_client/README.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ usage: get_model_status.py [-h] [--grpc_address GRPC_ADDRESS]
3333

3434
```
3535

36-
- Optional Arguments
36+
- Arguments
3737

3838
| Argument | Description |
3939
| :--- | :---- |
@@ -71,7 +71,7 @@ usage: get_serving_meta.py [-h] [--grpc_address GRPC_ADDRESS]
7171

7272
```
7373

74-
- Optional Arguments
74+
- Arguments
7575

7676
| Argument | Description |
7777
| :--- | :---- |
@@ -112,10 +112,14 @@ usage: grpc_serving_client.py [-h] --images_numpy_path IMAGES_NUMPY_PATH
112112
[--iterations ITERATIONS]
113113
[--batchsize BATCHSIZE]
114114
[--model_name MODEL_NAME]
115-
[--pipeline_name PIPELINE_NAME]
115+
[--pipeline_name PIPELINE_NAME]
116+
[--tls]
117+
[--server_cert SERVER_CERT]
118+
[--client_cert CLIENT_CERT]
119+
[--client_key CLIENT_KEY]
116120
```
117121

118-
- Optional Arguments
122+
- Arguments
119123

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

136144

137145
- Usage example
@@ -199,9 +207,10 @@ usage: jpeg_classification.py [-h] [--images_list IMAGES_LIST]
199207
[--input_name INPUT_NAME]
200208
[--output_name OUTPUT_NAME]
201209
[--model_name MODEL_NAME] [--size SIZE]
210+
[--rgb_image RGB_IMAGE]
202211
```
203212

204-
- Optional Argument
213+
- Arguments
205214

206215
| Argument | Description |
207216
| :--- | :---- |
@@ -213,7 +222,7 @@ usage: jpeg_classification.py [-h] [--images_list IMAGES_LIST]
213222
| --output_name | Specify output name. Default: resnet_v1_50/predictions/Reshape_1 |
214223
| --model_name | Define model name, must be same as is in service. Default: resnet|
215224
| --size SIZE | The size of the image in the model|
216-
225+
| --rgb_image RGB_IMAGE | Convert BGR channels to RGB channels in the input image |
217226

218227
- Usage example
219228

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

277-
- Optional Arguments
286+
- Arguments
278287

279288
| Argument | Description |
280289
| :--- | :---- |
@@ -341,7 +350,7 @@ usage: rest_get_model_status.py [-h] [--rest_url REST_URL]
341350
[--model_name MODEL_NAME]
342351
[--model_version MODEL_VERSION]
343352
```
344-
- Optional arguements
353+
- Arguments
345354

346355
| Argument | Description |
347356
| :--- | :---- |
@@ -376,7 +385,7 @@ usage: get_serving_meta.py [-h] [--grpc_address GRPC_ADDRESS]
376385
[--grpc_port GRPC_PORT] [--model_name MODEL_NAME]
377386
[--model_version MODEL_VERSION]
378387
```
379-
- Optional arguements
388+
- Arguments
380389

381390
| Argument | Description |
382391
| :--- | :---- |
@@ -471,9 +480,13 @@ usage: rest_serving_client.py [-h] --images_numpy_path IMAGES_NUMPY_PATH
471480
[--model_name MODEL_NAME]
472481
[--request_format {row_noname,row_name,column_noname,column_name}]
473482
[--model_version MODEL_VERSION]
483+
[--client_cert CLIENT_CERT]
484+
[--client_key CLIENT_KEY]
485+
[--ignore_server_verification]
486+
[--server_cert SERVER_CERT]
474487
```
475488

476-
- Optional Arguments :
489+
- Arguments :
477490

478491
| Argument | Description |
479492
| :--- | :---- |
@@ -491,6 +504,10 @@ usage: rest_serving_client.py [-h] --images_numpy_path IMAGES_NUMPY_PATH
491504
| --model_name MODEL_NAME| Define model name, must be same as is in service. Default: resnet|
492505
| --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|
493506
| --model_version MODEL_VERSION| Model version to be used. Default: LATEST |
507+
| --client_cert CLIENT_CERT | Specify mTLS client certificate file. Default: None |
508+
| --client_key CLIENT_KEY | Specify mTLS client key file. Default: None |
509+
| --ignore_server_verification | Skip TLS host verification. Do not use in production. Default: False |
510+
| --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 |
494511

495512
- Usage Example
496513
```bash

example_client/face_detection.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ usage: face_detection.py [-h] [--input_images_dir INPUT_IMAGES_DIR]
1616
[--output_dir OUTPUT_DIR] [--batch_size BATCH_SIZE]
1717
[--width WIDTH] [--height HEIGHT]
1818
[--grpc_address GRPC_ADDRESS] [--grpc_port GRPC_PORT]
19+
[--model_name MODEL_NAME] [--tls]
20+
[--server_cert SERVER_CERT]
21+
[--client_cert CLIENT_CERT] [--client_key CLIENT_KEY]
1922

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

23-
optional arguments:
26+
Arguments:
2427
-h, --help show this help message and exit
2528
--input_images_dir INPUT_IMAGES_DIR
2629
Directory with input images
2730
--output_dir OUTPUT_DIR
28-
Directory for staring images with detection results
31+
Directory for storing images with detection results
2932
--batch_size BATCH_SIZE
3033
how many images should be grouped in one batch
3134
--width WIDTH how the input image width should be resized in pixels
@@ -34,6 +37,15 @@ optional arguments:
3437
Specify url to grpc service. default:localhost
3538
--grpc_port GRPC_PORT
3639
Specify port to grpc service. default: 9000
40+
--model_name MODEL_NAME
41+
Specify the model name
42+
--tls use TLS communication with gRPC endpoint
43+
--server_cert SERVER_CERT
44+
Path to server certificate
45+
--client_cert CLIENT_CERT
46+
Path to client certificate
47+
--client_key CLIENT_KEY
48+
Path to client key
3749
```
3850

3951
## Usage example

example_client/face_detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def load_image(file_path):
3939
'it relies on model face_detection...')
4040

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

0 commit comments

Comments
 (0)