https://github.com/itsluketwist/sports-image-prediction
Predicting a sport from an image using PyTorch and CNNs!
https://github.com/itsluketwist/sports-image-prediction
cnn cnn-pytorch pytorch sports
Last synced: 3 months ago
JSON representation
Predicting a sport from an image using PyTorch and CNNs!
- Host: GitHub
- URL: https://github.com/itsluketwist/sports-image-prediction
- Owner: itsluketwist
- License: mit
- Created: 2023-11-19T22:12:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-25T22:45:49.000Z (over 1 year ago)
- Last Synced: 2024-10-17T09:54:01.221Z (8 months ago)
- Topics: cnn, cnn-pytorch, pytorch, sports
- Language: Jupyter Notebook
- Homepage:
- Size: 78.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **sports-image-prediction**
A simple python project that takes an image of a sport, and uses a CNN to make a prediction about
which sport it is!
## *usage*
Follow `predict_sport.ipynb` for easy access to the prediction code.
Otherwise install with:
```shell
pip install -e .
```And run predictions (or re-train / re-evaluate the model) via the command line using `run`.
```shell
run predict -i output/sports_mod_tuned.pth -s sample/basketball.png
```To retrain the model, check and update the hyperparameters in `src/train.py`, then run:
```shell
run train
```## *set-up and development*
Clone the repository code:
```shell
git clone https://github.com/itsluketwist/sports-image-prediction.git
```Once cloned, install the requirements locally in a virtual environment:
```shell
python -m venv venv. venv/bin/activate
pip install -e ".[dev]"
```Install and use pre-commit to ensure code is in a good state:
```shell
pre-commit installpre-commit autoupdate
pre-commit run --all-files
```## *inspiration*
Wanted to learn more about neural networks, and get some experience building wqith PyTorch.