ONNX
Satyam Goyal commited on
Commit
5869ab3
·
1 Parent(s): 960f622

Merge pull request #95 from Satgoy152:adding-doc

Browse files

Improved help messages for demo programs (#95)
- Added Demo Documentation
- Updated help messages
- Changed exception link

Files changed (2) hide show
  1. README.md +8 -5
  2. demo.py +4 -4
README.md CHANGED
@@ -6,18 +6,22 @@ This model is ported from [PaddleHub](https://github.com/PaddlePaddle/PaddleHub)
6
 
7
  Results of accuracy evaluation with [tools/eval](../../tools/eval).
8
 
9
- | Models | Top-1 Accuracy | Top-5 Accuracy |
10
- | ------ | -------------- | -------------- |
11
- | PP-ResNet | 82.28 | 96.15 |
12
- | PP-ResNet quant | 0.22 | 0.96 |
13
 
14
  \*: 'quant' stands for 'quantized'.
15
 
16
  ## Demo
17
 
18
  Run the following command to try the demo:
 
19
  ```shell
20
  python demo.py --input /path/to/image
 
 
 
21
  ```
22
 
23
  ## License
@@ -29,4 +33,3 @@ All files in this directory are licensed under [Apache 2.0 License](./LICENSE).
29
  - https://arxiv.org/abs/1512.03385
30
  - https://github.com/opencv/opencv/tree/master/samples/dnn/dnn_model_runner/dnn_conversion/paddlepaddle
31
  - https://github.com/PaddlePaddle/PaddleHub
32
-
 
6
 
7
  Results of accuracy evaluation with [tools/eval](../../tools/eval).
8
 
9
+ | Models | Top-1 Accuracy | Top-5 Accuracy |
10
+ | --------------- | -------------- | -------------- |
11
+ | PP-ResNet | 82.28 | 96.15 |
12
+ | PP-ResNet quant | 0.22 | 0.96 |
13
 
14
  \*: 'quant' stands for 'quantized'.
15
 
16
  ## Demo
17
 
18
  Run the following command to try the demo:
19
+
20
  ```shell
21
  python demo.py --input /path/to/image
22
+
23
+ # get help regarding various parameters
24
+ python demo.py --help
25
  ```
26
 
27
  ## License
 
33
  - https://arxiv.org/abs/1512.03385
34
  - https://github.com/opencv/opencv/tree/master/samples/dnn/dnn_model_runner/dnn_conversion/paddlepaddle
35
  - https://github.com/PaddlePaddle/PaddleHub
 
demo.py CHANGED
@@ -29,14 +29,14 @@ try:
29
  help_msg_backends += "; {:d}: TIMVX"
30
  help_msg_targets += "; {:d}: NPU"
31
  except:
32
- print('This version of OpenCV does not support TIM-VX and NPU. Visit https://gist.github.com/fengyuentau/5a7a5ba36328f2b763aea026c43fa45f for more information.')
33
 
34
  parser = argparse.ArgumentParser(description='Deep Residual Learning for Image Recognition (https://arxiv.org/abs/1512.03385, https://github.com/PaddlePaddle/PaddleHub)')
35
- parser.add_argument('--input', '-i', type=str, help='Path to the input image.')
36
- parser.add_argument('--model', '-m', type=str, default='image_classification_ppresnet50_2022jan.onnx', help='Path to the model.')
37
  parser.add_argument('--backend', '-b', type=int, default=backends[0], help=help_msg_backends.format(*backends))
38
  parser.add_argument('--target', '-t', type=int, default=targets[0], help=help_msg_targets.format(*targets))
39
- parser.add_argument('--label', '-l', type=str, default='./imagenet_labels.txt', help='Path to the dataset labels.')
40
  args = parser.parse_args()
41
 
42
  if __name__ == '__main__':
 
29
  help_msg_backends += "; {:d}: TIMVX"
30
  help_msg_targets += "; {:d}: NPU"
31
  except:
32
+ print('This version of OpenCV does not support TIM-VX and NPU. Visit https://github.com/opencv/opencv/wiki/TIM-VX-Backend-For-Running-OpenCV-On-NPU for more information.')
33
 
34
  parser = argparse.ArgumentParser(description='Deep Residual Learning for Image Recognition (https://arxiv.org/abs/1512.03385, https://github.com/PaddlePaddle/PaddleHub)')
35
+ parser.add_argument('--input', '-i', type=str, help='Usage: Set input path to a certain image, omit if using camera.')
36
+ parser.add_argument('--model', '-m', type=str, default='image_classification_ppresnet50_2022jan.onnx', help='Usage: Set model path, defaults to image_classification_ppresnet50_2022jan.onnx.')
37
  parser.add_argument('--backend', '-b', type=int, default=backends[0], help=help_msg_backends.format(*backends))
38
  parser.add_argument('--target', '-t', type=int, default=targets[0], help=help_msg_targets.format(*targets))
39
+ parser.add_argument('--label', '-l', type=str, default='./imagenet_labels.txt', help='Usage: Set path to the different labels that will be used during the detection. Default list found in imagenet_labels.txt')
40
  args = parser.parse_args()
41
 
42
  if __name__ == '__main__':