Downloads · 30 days
0
Purjeet979/tennis-play-vs-nonplay
tennis-play-vs-nonplay is a image classification model from Purjeet979. Use it when you need a label for an image. The card lists the license as mit.
This is a fine-tuned ResNet-18 model designed to classify frames from tennis broadcast videos into two categories: - Play: Frames where a tennis rally is actively taking place. - Non-Play: Frames containing crowd shot…
Downloads · 30 days
0
Access
Public
Updated Sep 10, 2026
Repo size
44.8 MB
Likes
1
Public
Click a slice to open those files.
.pth44.8 MB · 100%
From the Hugging Face model README
This is a fine-tuned ResNet-18 model designed to classify frames from tennis broadcast videos into two categories:
This model was trained to help automate the creation of tennis match highlights by filtering out all non-action sequences.
The model was trained on a custom dataset extracted from grand slam matches (Wimbledon, US Open, Roland Garros). Frames were extracted and manually sorted into Play and Non-Play directories to create a robust ground-truth dataset.
import torch
import torchvision.models as models
import torch.nn as nn
# 1. Load the ResNet-18 architecture
model = models.resnet18()
num_ftrs = model.fc.in_features
model.fc = nn.Linear(num_ftrs, 2) # 2 classes: Play and Non-Play
# 2. Load the trained weights
state_dict = torch.load('play_vs_nonplay.pth', map_location='cpu')
model.load_state_dict(state_dict)
model.eval()
# 3. Model is now ready for inference!