## 1.Install requirements：
```
pip3.7.5 install python-opencv
cd backend_C++/dnmetis_backend
pip3.7.5 setup.py install
```
Details of dnmetis_backend installation can be found in backend_C++/dnmetis_backend/README.md. Notice that, you just need to install requirements once for a brand new Ai1-Inference environment。

## 2.Download model(.om)

Here is an example of how to run npu inference of efficientnet-b8:\
1.download  efficientnet-b8 model(.om): \
URL：[baidu pan](https://pan.baidu.com/s/1N-kpQoDe3NRxvjFKjAT9AA) \
Extracted code：tvg0  

Original tensorflow model of efficientnet-b8(.pb):\
URL：[baidu pan](https://pan.baidu.com/s/1CajdSlNTh6k35RoyOn-3Ug)\
Extracted code：slqm 

If you want to acknowledge how to generate om from pb，pls download efficientnet-b8.pb and execute ATC cmd：\
.atc --model=MODELDIR/efficientnet−b8.pb −−framework=3 −−inputshape=′images:1,672,672,3′−−output=MODELDIR/efficientnet-b8 --mode=0 --out_nodes='Softmax:0' --soc_version=Ascend310 --input_fp16_nodes=images --output_type=FP16

2.Imagenet-val dataset and labels in val_map.txt:

![输入图片说明](https://images.gitee.com/uploads/images/2020/0918/234302_a572d632_5418572.jpeg "无标题.jpg")



## 3.Start execute the inference:

bash run_inference.sh


## 4.Top1 Accuracy of entire Imagenet2012-val Datasets(5w pictures):

![输入图片说明](https://images.gitee.com/uploads/images/2020/0919/010210_5cf496fc_5418572.png "屏幕截图.png")


## 5.modify main.py for your own model:

1.download  efficientnet-b8 model(.pb) URL: obs://hwwheel23/efficientnet-b8.pb 

2.atc --model=$MODEL_DIR/efficientnet-b8.pb --framework=3 --input_shape='images:1,672,672,3' --output=$MODEL_DIR/efficientnet-b8 --mode=0 --out_nodes='Softmax:0' --soc_version=Ascend310  --input_fp16_nodes=images --output_type=FP16


