{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 3. Getting Started with Pre-trained Models on ImageNet\n\n`ImageNet `__ is a\nlarge labeled dataset of real-world images. It is one of the most\nwidely used dataset in latest computer vision research.\n\n|imagenet|\n\nIn this tutorial, we will show how a pre-trained neural network\nclassifies real world images.\n\nFor your convenience, we provide a script that loads a pre-trained ``ResNet50_v2`` model,\nand classifies an input image.\nFor a list of all models we have, please visit `Gluon Model Zoo <../../model_zoo/index.html>`__.\n\n## Demo\n\nA model trained on ImageNet can classify images into 1000 classes, this makes it\nmuch more powerful than the one we showed in the `CIFAR10 demo `__.\n\n:download:`Download demo_imagenet.py<../../../scripts/classification/imagenet/demo_imagenet.py>`\n\nWith this script, you can load a pre-trained model and classify any image you have.\n\nLet's test with the photo of Mt. Baker again.\n\n|image0|\n\n::\n\n python demo_imagenet.py --model ResNet50_v2 --input-pic mt_baker.jpg\n\nAnd the model predicts that\n\n::\n\n The input picture is classified to be\n \t[volcano], with probability 0.558.\n \t[alp], with probability 0.398.\n \t[valley], with probability 0.018.\n \t[lakeside], with probability 0.006.\n \t[mountain_tent], with probability 0.006.\n\nThis time it does a good job. Note that we have listed the top five\nmost probable classes, because with 1000 classes the model may not always rank the\ncorrect answer highest. Besides top-1 accuracy, we often also\nconsider top-5 accuracy as a measurement of how well a model can predict.\n\n## Next Step\n\nIf you would like to dive deeper into ``ImageNet`` training,\nfeel free to read the next tutorial on `ImageNet Training `__.\n\nOr, if you would like to know how to train a powerful model tailored to your own data,\nplease go ahead and read the tutorial on `Transfer learning `__.\n\n.. |imagenet| image:: https://raw.githubusercontent.com/dmlc/web-data/master/gluoncv/datasets/imagenet_mosaic.jpg\n.. |image0| image:: https://raw.githubusercontent.com/dmlc/web-data/master/gluoncv/classification/mt_baker.jpg\n\n\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}