- Goes through the basics of pytorch in relation to computer vision
- Takes a look at components such as embeddings
- Practice on common routines
pip install torch torchvision opencv-python streamlitLocation: computer-vision/
Dataset: computer-vision/datasets/cat_dog_small/ with cats/ and dogs/ subfolders containing .jpg files.
Examples:
- Build a custom dataset and inspect samples:
python computer-vision/basic_classification/example_1_building_the_dataset.py
- Train/val split with
random_split:python computer-vision/basic_classification/example_2_splitting_data.py
- Train a simple CNN and save a model checkpoint:
This writes
python computer-vision/basic_classification/example_3_basic_classification.py
computer-vision/basic_classification/cat_dog_cnn.pth.
Use the saved model from the training step to run the demo app:
streamlit run computer-vision/basic_classification/example_3_1_basic_streamlit_app.pyUpload cat_dog_cnn.pth and a cat/dog image to get a prediction.