We want to take the MobileNet implementation with PyTorch and try to extend it.
The goal is to use some data from the Food 101 dataset and try to use it to extend MobileNet so that it can classify pictures of food as well.
Make sure you are using Python 3: python --version
. On Ubuntu, you can probably use the python3
command to resolve any ambiguities.
Create an environment directory, the packages you install with pip
(for instance, PyTorch) will be stored there. I put it in the "env" directory.
virtualenv -p python3 env
Activate the virtual environment:
# If you are using bash
source env/bin/activate
Your prompt should have if the activation of the virtual env worked.
If you want to use a Jupyter notebook, you can install Jupyter and all the required packages
pip install -r packages
And then:
jupyter notebook
Warning: You may have to run these commands even if you have Jupyter installed on your machine already, as it's set up to work with your packages when installed this way.
You need to go on the PyTorch page and choose from a selector the things you have, it will generate a command to paste in your terminal to install it.
You need to download the images from kaggle.
There are three models that were saved at different stages of learning.
food_model_2e7
: Model 2 epoch 7 - MobileNet with only last layer re-trained (epoch 7)food_model_2e0
: Model 2 epoch 0 - MobileNet with only last layer re-trained (epoch 0)food_model_e2
: Model 1 epoch 2 - MobileNet architecture re-trained on the food data set (without re-initliazing the weights).