Hi Mike, how’s your project going? Would be great to hear how you got on :)
The code snippet you are referencing here is for the CNN model which uses a modified version of the extract_features function (versus the extract_features snippet in the blog which was for a different model) . Full explanation is in this Jupyter notebook https://github.com/mikesmales/Udacity-ML-Capstone/blob/master/Notebooks/4%20Model%20Refinement.ipynb
I would also recommend running the whole Jupyter notebook found in the GitHub repo as it is more inclusive than the snippets that I put in the blog https://github.com/mikesmales/Udacity-ML-Capstone