This project supports both classical machine learning and deep learning for the Tom and Jerry dataset.
- Total images: 5478 (1 FPS frames)
- Original labeled folders:
tom: images containing only Tomjerry: images containing only Jerrytom_jerry_1: images containing both Tom and Jerrytom_jerry_0: images containing neither
- Metadata:
ground_truth.csv: frame-level labels (tom,jerry)challenges.csv: difficult/distorted samples for error analysis
Default 4-class classification setup in this repository uses:
tomjerrytom_jerry_0tom_jerry_1
data/Tom_and_Jerry_Dataset/tom_and_jerry/tom_and_jerry/
The loader auto-resolves this nested path from data/Tom_and_Jerry_Dataset.
.
├── configs/
│ ├── deep.yaml
│ ├── classical.yaml
│ └── default.yaml
├── scripts/
│ ├── train.ps1
│ ├── evaluate.ps1
│ ├── predict.ps1
│ ├── build_split.ps1
│ ├── train_classical.ps1
│ ├── predict_classical.ps1
│ └── screen_time.ps1
├── src/
│ ├── data.py
│ ├── model.py
│ ├── train.py
│ ├── evaluate.py
│ ├── predict.py
│ ├── splits.py
│ ├── build_split.py
│ ├── classical_train.py
│ ├── classical_predict.py
│ ├── screen_time.py
│ └── classical/
│ ├── features.py
│ └── models.py
└── outputs/
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txtTrain:
python -m src.train --config configs/deep.yamlEvaluate:
python -m src.evaluate --data-dir data/Tom_and_Jerry_Dataset/tom_and_jerry/tom_and_jerry --checkpoint outputs/checkpoints/best.ptPredict single image:
python -m src.predict --image path/to/image.jpg --checkpoint outputs/checkpoints/best.pt --top-k 3Build stratified train/val/test split:
python -m src.build_split --config configs/classical.yamlTrain + evaluate:
python -m src.classical_train --config configs/classical.yamlPredict single image:
python -m src.classical_predict --image path/to/image.jpg --model outputs/models/classical_model.joblibpython -m src.screen_time --ground-truth data/Tom_and_Jerry_Dataset/ground_truth.csvThis prints total seconds in 4 states:
tom_onlyjerry_onlytom_jerry_1tom_jerry_0
Also prints the longest continuous streak where both Tom and Jerry appear together.
configs/classical.yamlfeature.name:raw | hog | siftmodel.name:svm | rf | nbuse_pca,pca_components- split ratios: train/val/test
configs/deep.yaml- model backbone, image size, epochs, batch size, learning rate
- Add challenge-set evaluation by filtering images listed in
challenges.csv. - Add experiment tracking and confusion-matrix exports under
outputs/runs/. - Add model registry and hyperparameter sweep support for reproducible comparisons.