Giter VIP home page Giter VIP logo

mrinal18 / nfl_kaggle Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 3.0 106.59 MB

The National Football League (NFL) and Amazon Web Services (AWS)teamed up to develop the best sports injury surveillance and mitigation programvia the Kaggle competition. Through which the NFL wants to assign specificplayers to each helmet, which would help accurately identify each player’s “ex-posures” throughout a football play. We are trying to implement a computer vi-sion based ML algorithms capable of assigning detected helmet impacts to correctplayers via tracking information. Our paper will explain the approach to automati-cally track player helmets and their collisions. This will also allow them to reviewprevious plays and explore the trends in exposure over time.

License: MIT License

Jupyter Notebook 99.98% Python 0.02%
hacktoberfest

nfl_kaggle's Introduction

Introduction

The National Football League is America’s most popular sports league. Founded in 1920, the NFLdeveloped the model for the successful modern sports league and is committed to advancing progressin the diagnosis, prevention, and treatment of sports-related injuries. Health and safety efforts in-clude support for independent medical research and engineering advancements as well as a com-mitment to work to better protect players and make the game safer, including enhancements tomedical protocols and improvements to how our game is taught and played. This work was done foranalysing sports injury and mitigating this problem by surveying them. there are few novel worksbefore where they detected the helmet impacts, but here they are taking it to the next level by as-signing each player to each helmet and accurately identity player’s exposure throughout footballplaysCurrently, NFL annotates each subset of players each year to check the exposure and to expand thisfeature they require the field view to determine each and every players positions. This competition will be a subset of the previous year’s competition from kaggle.com, and we will be using almostsame dataset with more information given to use on dataset. Along with information, each playeris associated with videos, showing a sideline and endzone views which are aligned so that frames corresponds between the two videos. To aid with helmet detection, we are also provided an ancillarydataset of images showing helmets with labeled bounding boxes. This year they also providing baseline helmet detection boxes for the training and test set. As per the rule after submission of thiscode, they will run the submitted model in 15 unseen plays that is a part of a holdout traning set.During the competition participants are evaluated on the test set and a part of the predictions is usedto calculate the above mentioned metrics and show the best score for each participant on a publicleaderboard. After the competition the score with respect to the remaining part is released and usedto determine and display the final scoring (private leaderboard). For training our models we usedPytorch with object detection algorithms with tracking. Moreover, we use several implementations.

Implementation

The Notebooks are divided in following manner in our page:

  • EDA
  • MODEL
  • Evaluation

EDA:

The main task before we even start our modelling part is to first understand our data and inferwhat we can extract from that information. First we looked into the basic information on whatdata is being given to us and how we will represent those data. we came across information likethe bounding box information has been provided for each player. Our main training data consistof playerid, x-y coordinate of those players, direction of the players,the snap information, teaminformation and which frame they belong to. While trying to understand the training and testinginformation, we found that testing data is a subset of training information. We have 120 trainingvideos out of which 60 are sidezone and 60 are endzone images (8). Does Sideline and Endzone Video has same frame? No, 25 plays out of 60 doesn’t match and the difference is mostly 1 framebut there are 7 frame difference also. We checked even the biggest and smallest size of the helmet,that means that with respect to the frame, how much percentage is being taken by an individual helmets.

Model Implementation:

Since we are working on the multi object detection, we started using a model that works really powerfully while detecting the images, hence, we used YOlOv5 for our case, but along with this wealso wanted to use algorithms for tracking the players in our case. This gave rise to a combination of YOLOv5 and DeepSort algorithms. In this section we will be discussing about various methodsthat we used to make our final model work. Our solution consist of the following stages

  • Use YOLOv5 for detecting helmets.
  • Use deepsort to track the helmet.
  • Tracking Players:
    • Use ICP (Iterative Closest Point) and the Hungarian algorithm to assign helmet boxesto the tracking data for each frame.
    • Divide helmets into two clusters using k-means based on the color of the helmet.
    • Use ICP (Iterative Closest Point) and the Hungarian algorithm to assign helmet boxesto the tracking data again, taking into account the results of deepsort and the helmetcolor information.
    1. Use the Hungarian algorithm to determine the final label

Evaluation:

Please refer to Evaluation notebooks in Eval directory, we implemented all our metrics using Weights and Bais Dashboards

nfl_kaggle's People

Contributors

mrinal18 avatar archana-bc avatar nvk681 avatar lalalaurenville avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

nfl_kaggle's Issues

:sparkles: **Welcome to GitHub Projects** :sparkles:

We're so excited that you've decided to create a new project! Now that you're here, let's make sure you know how to get the most out of GitHub Projects.

  • Create a new project
  • Give your project a name
  • Press the ? key to see available keyboard shortcuts
  • Add a new column
  • Drag and drop this card to the new column
  • Search for and add issues or PRs to your project
  • Manage automation on columns
  • Archive a card or archive all cards in a column

>what is a model?

How to select a model?
Reading research papers . To find which model best suites our data?( Do not go with good model go for better model ? )
Documentation for model selection ><

Things we can try from solutions

@nvk681 @lalalaurenville @gsvsumanth @Archana-bc

  1. Confidence : 0.01 - 0.7
  2. IOU score : 0.01 or 0.35
  3. Angle (havent tried yet)
  4. Direction of moment (havent tried yet)
  5. Epochs < (10-15)
  6. Tracking of helmets
  7. Limited players <= 22
  8. Check for outlier bounding boxes by taking fps as consideration. : needs experimenting.

What we have now
9. Baseline model: 0.6
10. Tracking angles : 0.806

Something to learn:
Hungarian Algorithm

What we can do: Next Wednesday

  1. https://www.kaggle.com/c/nfl-health-and-safety-helmet-assignment/discussion/285286

  2. https://www.kaggle.com/c/nfl-health-and-safety-helmet-assignment/discussion/285076

  3. https://www.kaggle.com/c/nfl-health-and-safety-helmet-assignment/discussion/285065

  4. https://www.kaggle.com/c/nfl-health-and-safety-helmet-assignment/discussion/284940

  5. Try with different values IOU, conf
    Tracking angles
    -> Check for outlier bounding boxes by taking fps as consideration. : needs experimenting. People can split and try to experimenting
    -> Tracking of helmets

Notebooks to work on:

  1. https://www.kaggle.com/mrinalmathur/testing-deepsort/edit/run/77737624 : deep sort + yolo5 only

  2. https://www.kaggle.com/mrinalmathur/deepsort-with-tracking-angles?scriptVersionId=78732225 deepsort + yolo5 + tracking

detectron2 runtime issues, in kaggle environment.

Running the test script or the command is giving run time errors.

Error for reference:
ImportError Traceback (most recent call last)
in
17 import detectron2
18 #Importing some common detectron2 utilities
---> 19 from detectron2 import model_zoo
20 from detectron2.engine import DefaultPredictor
21 from detectron2.config import get_cfg

/opt/conda/lib/python3.7/site-packages/detectron2/model_zoo/init.py in

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.