- This event has passed.
6:30 PM – AI / ML – Shawn
December 9, 2023 @ 6:30 pm - 7:30 pm
Today We Did
- Started our Cats Vs Dogs project
- Learned about Fastai, file paths, dataloaders, and machine learning models
- https://colab.research.google.com/drive/1YxHrVsv_qDhywniQqR0RAKTAdR8q3Hno?usp=sharing
Homework
- You might have to re-run all the cells to use your model if you leave the page and come back to it.
- Go to Runtime -> Change Runtime and make sure T4 GPU is selected
- Go to Runtime -> Run All
- Try predicting some images using
learn.predict(files[0])
. Play around with the 0 to change around the images as well! - Run
learn.show_results()
a couple times. See how your learner does. - Add the following code:
from google.colab import files uploaded_file = files.upload()
img_content = None for file_name in uploaded_file.keys(): img_content = uploaded_file[file_name]
- Above code will provide an upload button. Click the upload button and upload a cat or dog image of your own. You can find a cat or dog image from google.
- Try passing in the img_content you upload into learn.predict, and see the result. If you upload a cat image then, learn.predict(img_content) will return True. If not will return False.
Email me at szhuang@ayclogic.com if you have any questions!