Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
model_name: inception-v1-9.onnx
|
| 5 |
+
tags:
|
| 6 |
+
- validated
|
| 7 |
+
- vision
|
| 8 |
+
- classification
|
| 9 |
+
- inception_and_googlenet
|
| 10 |
+
- inception_v1
|
| 11 |
+
---
|
| 12 |
+
<!--- SPDX-License-Identifier: MIT -->
|
| 13 |
+
|
| 14 |
+
# Inception v1
|
| 15 |
+
|
| 16 |
+
|Model |Download |Download (with sample test data)| ONNX version |Opset version| Top-1 accuracy (%)|
|
| 17 |
+
| ------------- | ------------- | ------------- | ------------- | ------------- |------------- |
|
| 18 |
+
|Inception-1| [28 MB](model/inception-v1-3.onnx) | [29 MB](model/inception-v1-3.tar.gz) | 1.1 | 3| |
|
| 19 |
+
|Inception-1| [28 MB](model/inception-v1-6.onnx) | [29 MB](model/inception-v1-6.tar.gz) | 1.1.2 | 6| |
|
| 20 |
+
|Inception-1| [28 MB](model/inception-v1-7.onnx) | [29 MB](model/inception-v1-7.tar.gz) | 1.2 | 7| |
|
| 21 |
+
|Inception-1| [28 MB](model/inception-v1-8.onnx) | [29 MB](model/inception-v1-8.tar.gz) | 1.3 | 8| |
|
| 22 |
+
|Inception-1| [28 MB](model/inception-v1-9.onnx) | [29 MB](model/inception-v1-9.tar.gz) | 1.4 | 9| |
|
| 23 |
+
|Inception-1| [27 MB](model/inception-v1-12.onnx) | [25 MB](model/inception-v1-12.tar.gz) | 1.9 | 12| 67.23|
|
| 24 |
+
|Inception-1-int8| [10 MB](model/inception-v1-12-int8.onnx) | [9 MB](model/inception-v1-12-int8.tar.gz) | 1.9 | 12| 67.24|
|
| 25 |
+
|Inception-1-qdq| [7 MB](model/inception-v1-12-qdq.onnx) | [5 MB](model/inception-v1-12-qdq.tar.gz) | 1.12 | 12 | 67.21 |
|
| 26 |
+
> Compared with the fp32 Inception-1, int8 Inception-1's Top-1 accuracy drop ratio is -0.01% and performance improvement is 1.26x.
|
| 27 |
+
>
|
| 28 |
+
> **Note**
|
| 29 |
+
>
|
| 30 |
+
> The performance depends on the test hardware. Performance data here is collected with Intel® Xeon® Platinum 8280 Processor, 1s 4c per instance, CentOS Linux 8.3, data batch size is 1.
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
## Description
|
| 34 |
+
Inception v1 is a reproduction of GoogLeNet.
|
| 35 |
+
|
| 36 |
+
### Dataset
|
| 37 |
+
[ILSVRC2012](http://www.image-net.org/challenges/LSVRC/2012/)
|
| 38 |
+
|
| 39 |
+
## Source
|
| 40 |
+
Caffe2 Inception v1 ==> ONNX Inception v1
|
| 41 |
+
ONNX Inception v1 ==> Quantized ONNX Inception v1
|
| 42 |
+
|
| 43 |
+
## Model input and output
|
| 44 |
+
### Input
|
| 45 |
+
```
|
| 46 |
+
data_0: float[1, 3, 224, 224]
|
| 47 |
+
```
|
| 48 |
+
### Output
|
| 49 |
+
```
|
| 50 |
+
prob_1: float[1, 1000]
|
| 51 |
+
```
|
| 52 |
+
### Pre-processing steps
|
| 53 |
+
### Post-processing steps
|
| 54 |
+
### Sample test data
|
| 55 |
+
random generated sampe test data:
|
| 56 |
+
- test_data_0.npz
|
| 57 |
+
- test_data_1.npz
|
| 58 |
+
- test_data_2.npz
|
| 59 |
+
- test_data_set_0
|
| 60 |
+
- test_data_set_1
|
| 61 |
+
- test_data_set_2
|
| 62 |
+
|
| 63 |
+
## Results/accuracy on test set
|
| 64 |
+
|
| 65 |
+
## Quantization
|
| 66 |
+
Inception-1-int8 and Inception-1-qdq are obtained by quantizing fp32 Inception-1 model. We use [Intel® Neural Compressor](https://github.com/intel/neural-compressor) with onnxruntime backend to perform quantization. View the [instructions](https://github.com/intel/neural-compressor/blob/master/examples/onnxrt/image_recognition/onnx_model_zoo/inception/quantization/ptq/README.md) to understand how to use Intel® Neural Compressor for quantization.
|
| 67 |
+
|
| 68 |
+
### Environment
|
| 69 |
+
onnx: 1.9.0
|
| 70 |
+
onnxruntime: 1.8.0
|
| 71 |
+
|
| 72 |
+
### Prepare model
|
| 73 |
+
```shell
|
| 74 |
+
wget https://github.com/onnx/models/raw/main/vision/classification/inception_and_googlenet/inception_v1/model/inception-v1-12.onnx
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
### Model quantize
|
| 78 |
+
Make sure to specify the appropriate dataset path in the configuration file.
|
| 79 |
+
```bash
|
| 80 |
+
bash run_tuning.sh --input_model=path/to/model \ # model path as *.onnx
|
| 81 |
+
--config=inception_v1.yaml \
|
| 82 |
+
--data_path=/path/to/imagenet \
|
| 83 |
+
--label_path=/path/to/imagenet/label \
|
| 84 |
+
--output_model=path/to/save
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
## References
|
| 88 |
+
* [Going deeper with convolutions](https://arxiv.org/abs/1409.4842)
|
| 89 |
+
|
| 90 |
+
* [Intel® Neural Compressor](https://github.com/intel/neural-compressor)
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
## Contributors
|
| 94 |
+
* [mengniwang95](https://github.com/mengniwang95) (Intel)
|
| 95 |
+
* [airMeng](https://github.com/airMeng) (Intel)
|
| 96 |
+
* [ftian1](https://github.com/ftian1) (Intel)
|
| 97 |
+
* [hshen14](https://github.com/hshen14) (Intel)
|
| 98 |
+
|
| 99 |
+
## License
|
| 100 |
+
MIT
|
| 101 |
+
|