Since this repo does not contain everything needed to run the project I thought I would add some instructions on how to get everything working!
You will need to download the Inception model from here in order to make the transfer learning part work. The file you need is called tensorflow_inception_graph.pb
. Drop that file into the Trainer
console app and make sure to Copy to Output Directory
.
This part is a little trickier but totally doable! The first thing to do is get actual images to use in the training and validation process. To do that I use the handy Bulk Bing Image Downloader.
- Get the python script
- Create a file (I called it
tacos.txt
) and add the following:
tacos
burrito
- Run the python script as follows:
python bbid.py -f tacos.txt -o data --filters +filterui:license-L2_L3_L4+filterui:imagesize-large
This will basically download images that conform to a bing query for each line in the text file. (test it out for tacos). The filters download data that is licensed appropriately as well.
- Clean the data! Remove any images that will not work for this particular task.
- Seperate the data into a
train
andval
set. Thetrain
set is for training the Machine Learning model. Theval
set is used as a validation set to make sure the model is working properly. It is held out on purpose so we are not cheating! My folder structure:
data
└───train
│ └───burrito
│ | burrito_image1.jpg
│ | another_burrito21.jpg
│ | ...
│ └───tacos
│ taco_image1.jpg
│ another_taco21.jpg
│ ...
└───val
└───burrito
| burrito_other1.jpg
| another_burrito272.jpg
| ...
└───tacos
taco_other1.jpg
another_taco343.jpg
...
This folder (as currently coded) lives in the same folder as the solution file!
Basically because the files are not mine! I want to make sure you have access to the original files from their original locations. And also because this is how data science works!