DEV Community

Ryan Ro
Ryan Ro

Posted on

1 1

Player Detector

First Machine Learning Project

Created for an introduction to image understanding course.

Simple player detection, using PyTorch's Faster R-CNN model with a ResNet-50-FPN Backbone, with in-place horizontal flipping data augmentation.

Demo Link

https://github.com/ryanro97/player-detector/blob/master/predicted-1.gif
https://github.com/ryanro97/player-detector/blob/master/predicted-2.gif
https://drive.google.com/drive/folders/1oLPPxYUrAYwq40zxfc5OilLNLeyW4kct?usp=sharing

Link to Code

Player Detector

Player detection using PyTorch's Faster R-CNN model with a ResNet-50-FPN Backbone.

Training and validation images extracted using FFMPEG, and labeled using Tzuta Lin's LabelImg tool.

Both the Trainer and Predictor can be used to train and predict other objects, however the only data augmentation implemented is a horizontal flip, due to other augmentations not making much sense for player detection.

Further details to setup object detection are in the notebooks.

Examples:

Predicted Play 1:

Predicted Play 1

Predicted Play 2:

Predicted Play 2




How I built it (what's the stack? did I run into issues or discover something new along the way?)

Built on Jupyter Notebook using Python 3 and mainly the PyTorch library, with the addition of cv2 and skvideo packages. Trained using Google Colab's Tesla K80 GPU.

Additional Thoughts / Feelings / Stories

Though the outcome was satisfactory, optimizing parameters for a model with a dataset that takes roughly 12 hours to train is extremely time consuming and at times quite frustrating. This made me do a double take whether I wanted to go further into this area.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️