ML image model for detecting vehicles in an image
Clone the repo using:
git clone https://github.com/EggHeads-cs35l/image-model.git
For the rest of the setup, navigate to the cloned directory and run commands there.
We will be using Conda (Miniconda) to create our development environment: https://anaconda.org
Next, update conda by running:
conda update -n base -c defaults conda
Navigate to the miniconda installer page and download your correpsonding file: https://docs.conda.io/en/latest/miniconda.html
The process will enitrely depend on your development platform: Windows, WSL, MacOS, Linux.
Regardless of platform, we recommend installing via the bash script: simply run the downloaded script with the prefix bash <FILE>
Refer to the Conda cheat sheet for help with commands: https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf
Run the following commands to setup a conda environment:
Make sure to replace "<NAME>" with the actual name of the environemnt you wish to create.
conda create --name <NAME> python=3.9
We will be using Python 3.9.
You can activate and deactivate your conda environment using:
conda activate <NAME>
conda deactivate
or
source activate <NAME>
source deactivate
If you are using MacOS, we recommend using Apple Metal to enhance training using your GPU on Intel Macs or GPU cores on the new Apple Silicon: https://developer.apple.com/metal/tensorflow-plugin/
If you are on an Apple silicon Mac, run the following command first:
conda install -c apple tensorflow-deps
If you are on MacOS (either Intel or Apple silicon), run these commands:
install TensorFlow for MacOS
python -m pip install tensorflow-macos
install Metal fro TensorFlow
python -m pip install tensorflow-metal
We will be using TensorFlow for our ML framework: https://www.tensorflow.org
Run the following command (in the directory) sequentially to install dependencies:
conda install numpy pandas matplotlib
conda install -c conda-forge tensorflow pillow
conda install -c anaconda ipykernel
We will use the Stanford Cars Dataset: http://ai.stanford.edu/~jkrause/cars/car_dataset.html
3D Object Representations for Fine-Grained Categorization
Jonathan Krause, Michael Stark, Jia Deng, Li Fei-Fei
4th IEEE Workshop on 3D Representation and Recognition, at ICCV 2013 (3dRR-13). Sydney, Australia. Dec. 8, r013.
run all of the following commands sequentially:
mkdir data
cd data
curl http://ai.stanford.edu/~jkrause/car196/car_ims.tgz > images.tgz
curl http://ai.stanford.edu/~jkrause/car196/cars_annos.mat > info.mat
tar -xzf car_ims.tgz -C images/
We will create directories used later now so we don't accidentally create redundant directories run all of the following commands in the terminal (in this repo's directory):
cd data
mkdir dataset
cd dataset
mkdir {0..195}
To prevent from committing outputs of Jupyter code blocks run the following command:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'