Skip to content

Commit e8125c5

Browse files
bstrzeledkalinowski
authored andcommitted
Image classification cpp fix (#2141)
* Fixed image_classification/cpp demo * added input_images.txt with adjusted paths
1 parent f4805e9 commit e8125c5

File tree

2 files changed

+42
-9
lines changed

2 files changed

+42
-9
lines changed

demos/image_classification/cpp/README.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,43 @@ docker run -d -u $(id -u):$(id -g) -v $(pwd)/resnet50-binary:/model -p 9001:9001
3636

3737
## Start the client:
3838
```bash
39-
docker run --rm --network host -e "no_proxy=localhost" ovms_cpp_image_classification ./classification_client_sync --grpc_port=9001 --iterations=10 --layout="binary"
39+
docker run --rm --network host -e "no_proxy=localhost" -v ${PWD}/input_images.txt:/clients/input_images.txt ovms_cpp_image_classification ./classification_client_sync --grpc_port=9001 --iterations=10 --layout="binary"
4040

41+
Address: localhost
42+
Images list path: input_images.txt
43+
Layout: binary
44+
call predict ok
45+
call predict time: 6ms
46+
outputs size is 1
47+
call predict ok
48+
call predict time: 5ms
49+
outputs size is 1
50+
call predict ok
51+
call predict time: 4ms
52+
outputs size is 1
53+
call predict ok
54+
call predict time: 4ms
55+
outputs size is 1
56+
call predict ok
57+
call predict time: 4ms
58+
outputs size is 1
59+
call predict ok
60+
call predict time: 4ms
61+
outputs size is 1
62+
call predict ok
63+
call predict time: 5ms
64+
outputs size is 1
4165
call predict ok
42-
call predict time: 24ms
66+
call predict time: 4ms
4367
outputs size is 1
4468
call predict ok
45-
call predict time: 23ms
69+
call predict time: 4ms
4670
outputs size is 1
4771
call predict ok
48-
call predict time: 23ms
72+
call predict time: 5ms
4973
outputs size is 1
50-
...
51-
Overall accuracy: 90%
52-
Total time divided by number of requests: 25ms
74+
Overall accuracy: 100%
75+
Total time divided by number of requests: 5ms
5376
```
5477

5578
# Clients requesting predictions asynchronously
@@ -83,7 +106,7 @@ docker run -d -u $(id -u):$(id -g) -v $(pwd)/resnet50-binary:/model -p 9001:9001
83106

84107
### Start the client:
85108
```bash
86-
docker run --rm --network host -e "no_proxy=localhost" ovms_cpp_image_classification ./classification_client_async_benchmark --grpc_port=9001 --layout="nchw" --iterations=2000 --batch_size=1 --max_parallel_requests=100 --consumers=8 --producers=1 --benchmark_mode=1
109+
docker run --rm --network host -e "no_proxy=localhost" -v ${PWD}/input_images.txt:/clients/input_images.txt ovms_cpp_image_classification ./classification_client_async_benchmark --grpc_port=9001 --layout="nchw" --iterations=2000 --batch_size=1 --max_parallel_requests=100 --consumers=8 --producers=1 --benchmark_mode=1
87110

88111
Address: localhost:9001
89112
Model name: resnet
@@ -103,4 +126,4 @@ Producer threads: 1
103126
Consumer threads: 8
104127
Max parallel requests: 100
105128
Avg FPS: 1012.15
106-
```
129+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
images/airliner.jpeg 404
2+
images/arctic-fox.jpeg 279
3+
images/bee.jpeg 309
4+
images/golden_retriever.jpeg 207
5+
images/gorilla.jpeg 366
6+
images/magnetic_compass.jpeg 635
7+
images/peacock.jpeg 84
8+
images/pelican.jpeg 144
9+
images/snail.jpeg 113
10+
images/zebra.jpeg 340

0 commit comments

Comments
 (0)