[PyTorch] Added support of inference
Created by: a-sidorova
TODO:
-
Add validation table for classification models -
pytorch_models_checklist.md
Sample command line:
python3 inference_pytorch.py -mn alexnet -t classification -i ../../results/validation/images/ILSVRC2012_val_00000023.JPEG -is 1 3 224 224 --norm --mean 0.485 0.456 0.406 --std 0.229 0.224 0.225
Sample output:
[ INFO ] Get device for inference
[ INFO ] Inference will be executed on CPU
[ INFO ] Shape of the input layer data: [1, 3, 224, 224]
[ INFO ] Preparing input data ['../../results/validation/images/ILSVRC2012_val_00000023.JPEG']
[ INFO ] Starting inference (1 iterations) on CPU
[ INFO ] Computing performance metrics
[ INFO ] Converting output tensor to print results
[ INFO ] Inference results
[ INFO ] Top 5 results:
[ INFO ] Result for image 1
[ INFO ] 0.4499779 Granny Smith
[ INFO ] 0.0933098 dumbbell
[ INFO ] 0.0876729 ocarina, sweet potato
[ INFO ] 0.0628701 hair slide
[ INFO ] 0.0484683 bottlecap
[ INFO ] Performance results
[ INFO ] Average time of single pass : 0.010
[ INFO ] FPS : 95.414
[ INFO ] Latency : 0.010