00:02 Build a football analysis system using YOLO, OpenCV, and Python 02:23 Setting up folders and initializing the YOLO model for object detection 08:06 Demonstration of AI/ML football analysis system using YOLO, OpenCV, and Python 10:59 Understanding object detection and bounding boxes in AI/ML football analysis 16:42 Improving detection accuracy and excluding non-relevant objects 19:05 Utilizing Roboflow's football player detection dataset 24:19 Setting up football data set for AI/ML analysis 26:58 Moving data sets to specific folders for code reproducibility. 32:11 Training progress and downloading model weights 34:36 Using YOLO, OpenCV, and Python to analyze football with AI/ML 39:43 Setting up video reading and saving utilities with CV2 library 42:21 Setting up output video format and writing frames to video writer 47:48 Implementing object tracking for player analysis using bounding boxes. 50:46 Implementing object tracking using YOLO and a specific tracker 56:22 Setting minimum confidence for object detection and addressing false detections 58:57 Implementing object tracking with YOLO and OpenCV 1:04:59 Using YOLO and OpenCV for object detection in football analysis 1:07:41 Implementing class detection and verification in AI/ML Football Analysis system 1:13:09 Tracking and extracting bounding boxes for players, referees, and ball in a football video. 1:16:03 Implementing object tracking for football analysis using YOLO and OpenCV 1:21:24 Saving and loading data using pickle in Python 1:24:15 Developing code to visualize the predictions using circles instead of bounding boxes 1:30:17 Extracting center and width of bounding boxes for football analysis. 1:33:01 Drawing an ellipse using CV2 function 1:38:45 Implementing AI/ML tracking for players and referees in football analysis 1:41:31 Calculating X and Y positions for the rectangle center 1:46:46 Implementing object tracking and drawing in AI/ML Football Analysis system. 1:49:27 Defining triangle points based on bounding box for AI/ML Football Analysis. 1:55:25 Developing a football analysis system with Python and OpenCV 1:58:30 Implementing image processing and analysis in Python using YOLO and OpenCV 2:04:30 Implementing K-Means clustering for image segmentation 2:07:28 Determining player and non-player clusters using color analysis 2:13:06 Implementing a clustering model using K-means algorithm 2:16:00 Implementing K Means clustering for player color detection. 2:21:57 Implement player team identification using player ID and color 2:24:30 Assign players to teams based on their colors 2:30:26 Utilizing team colors for player tracking 2:33:07 Using pandas to interpolate missing values for more complete detections 2:38:45 Implementing ball tracking and player assignment using YOLO and OpenCV 2:41:22 Creating a module for player ball assignment 2:46:46 Assigning players to balls using AI algorithm 2:49:58 Implementing tracking of players with assigned players and has ball attribute 2:55:26 Drawing semi-transparent rectangles for football analysis 2:58:26 Calculate the percentage of time each team has the ball 3:04:46 Adjusting for camera motion to accurately measure player speed and distance 3:07:19 Detecting corner features and camera movement using Optical flow 3:12:50 Initializing parameters for feature extraction in AI/ML Football analysis 3:15:35 Setting parameters for feature extraction and tracking in football analysis 3:20:52 Implementing a function to measure distance and camera movement 3:23:50 Implementing camera movement detection using YOLO and OpenCV 3:29:58 Implementing camera movement tracking and displaying on the frame 3:32:58 Implementing player positions robust to camera movement 3:38:31 Adjusting positions according to camera movement 3:41:06 Implementing camera movement estimator for position adjustment 3:46:52 Discussing the football court dimensions and calculations 3:49:36 Converting camera-adjusted position to real-world positions 3:55:14 Implementing perspective transform and transforming points 3:58:06 Implementing transform Point function for AI/ML Football Analysis system 4:04:24 Creating a speed and distance estimator using Python. 4:07:39 Calculating speeds and distances for players using object tracking 4:13:36 Calculating speed and distance in football analysis 4:16:42 Implementing speed and distance calculations for object tracking in AI/ML football analysis system 4:22:42 Implementing speed and distance estimator in the main program. 4:25:55 Building an AI/ML Football Analysis System with YOLO and OpenCV Crafted by Merlin AI.
Absolutely fantastic tutorial! As someone keen on integrating machine learning and sports analysis, this video is a goldmine. The way you've utilized technologies like YOLOv8, KMeans, and optical flow to analyze football gameplay is incredibly insightful. Your step-by-step guide on fine-tuning the object detection models and implementing perspective transformation to measure real-world movements is super helpful. Thanks for putting together such a comprehensive guide and for sharing all the resources and your GitHub repo. Can’t wait to dive in and try out some of these techniques on my own projects. Great work! 👏👏👏
This is pretty cool! In a project I worked on a few years back we used a similar approach to create 3D simulations based on the data we gathered from the match broadcast. The project was used for the 2018 World Cup for a TV broadcaster in the US. Back then we relied a lot in approximation because the data was still very noisy. It's great to see progress in this field!
@@codeinajiffy Hey! Can we use the model on any football input video ? It show an value error: found array with 0 sample(s) (shape(0,3)) while a minimum of 1 is required by KMeans.
Tutorial looks insane and interesting even tough i'm not interested in machine learning i'm going to dive into this. Please keep up the good work with these tutorials!
This is a really value video! I got tons of insight from this tutorial! even though I'm not a machine learning engineer it definitely makes me find a door for entrance, subscribed!
wanna final yea mechanical engineer and football fan here, random UA-cam recommendation and undoubtedly one of the best. I absolutely despise coding but mate u had me glued to the screen. well done on an absolutely bonkers job. u earned my sub today
i really wish i picked this for my alevels coursework, now i'm stuck with some architectural project where i cant even find a tutorial on it, this proect seems so straight forward
great learning. I really enjoyed watching 4 hours long movie. I still need watch it again many times to get better hold of things. Please keep on keeping with this kind of analysis. Your teaching style is really simple and straight forward. 😇
I am at 1:37:37 and when i run it, i get "list index out of range" for player_dict = tracks['players'][frame_num] in the draw_annotations function and I cannot figure out why
Incredible video. I think some corrections are needed in the player' speed tracking. They seem to be overestimating the speed. Congratulations for such an incredible project!
Thank you so much for this video you are really humble that provides this types of videos for free because we invest so munch money to learn computer vision machine learning but its totally waste of money. Guys plz don't waste your money. You tube is really good platform to learn everything with free plz waste your time for searching and you will get gem youtube channel like this channel. I highly recommend that channel to my frds also
You got a like, that's for free. this type of content needs to be put out there, instead of misleading contents and reels. I'm not into this type of content. but I know that it needed a lot of work.
Hi! Nice tutorial and incredible video. I want to ask if you think this approach is good for determining passes, shots on target, etc. I'm considering using a custom dataset and maybe other tools. Do you have any ideas?
To anyone stuck on the !yolo task=detect mode=train model=yolov5x.pt data={dataset.location}/data.yaml epochs=100 imgsz=640 part: - Run the code below in a separate code line: %env PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True - Switch the runtime from CPU to T4/TPU v4
I am stuck on that. I'm try running into google colab,but I am facing the following error: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/trainer.py", line 517, in get_dataset data = check_det_dataset(self.args.data) File "/usr/local/lib/python3.10/dist-packages/ultralytics/data/utils.py", line 329, in check_det_dataset raise FileNotFoundError(m) FileNotFoundError: Dataset 'football-players-detection-1/data.yaml' images not found ⚠, missing path '/content/datasets/football-players-detection-1/football-players-detection-1/valid/images' Note dataset download directory is '/content/datasets'. You can update this in '/root/.config/Ultralytics/settings.yaml' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/bin/yolo", line 8, in sys.exit(entrypoint()) File "/usr/local/lib/python3.10/dist-packages/ultralytics/cfg/__init__.py", line 582, in entrypoint getattr(model, mode)(**overrides) # default args from model File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/model.py", line 654, in train self.trainer = (trainer or self._smart_load("trainer"))(overrides=args, _callbacks=self.callbacks) File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/trainer.py", line 130, in __init__ self.trainset, self.testset = self.get_dataset() File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/trainer.py", line 521, in get_dataset raise RuntimeError(emojis(f"Dataset '{clean_url(self.args.data)}' error ❌ {e}")) from e RuntimeError: Dataset 'football-players-detection-1/data.yaml' error ❌ Dataset 'football-players-detection-1/data.yaml' images not found ⚠, missing path '/content/datasets/football-players-detection-1/football-players-detection-1/valid/images' Note dataset download directory is '/content/datasets'. You can update this in '/root/.config/Ultralytics/settings.yaml' this is the data.yaml content: names: - ball - goalkeeper - player - referee nc: 4 roboflow: license: CC BY 4.0 project: football-players-detection-3zvbc url: universe.roboflow.com/roboflow-jvuqo/football-players-detection-3zvbc/dataset/1 version: 1 workspace: roboflow-jvuqo test: ../test/images train: football-players-detection-1/train/images val: football-players-detection-1/valid/images
raise SyntaxError(string + CLI_HELP_MSG) from e SyntaxError: 'Analysis\training\football-players-detection-1/data.yaml' is not a valid YOLO argument. it`s dosnt work for me :(
hey I tried doing it but I'm still stuck, it gives me this error but I'm sure that the missing path exists: RuntimeError: Dataset '/content/football-players-detection-1/data.yaml' error ❌ Dataset '/content/football-players-detection-1/data.yaml' images not found ⚠, missing path '/content/football-players-detection-1/football-players-detection-1/valid/images' Note dataset download directory is '/content/datasets'. You can update this in '/root/.config/Ultralytics/settings.yaml'
@@MitchellWillis-il7yk Train the model how? The dataset on kaggle isn't available to download now. He has put the single video he uses in the description but is just 1 video enough for training?
apparently if you are on windows without a gpu there is sometimes an issue. In a reddit post someone mentioned this and the solution is to downgrade pytorch (and also reinstall everything related to python). This fixed it for me
Fist of all, thank you so much for amazing tutorial. You are really genius. Your explanation is really excellent. However, I have question related to dataset. From the nature of football analysis, we have imbalanced dataset, over-representation for player class and under-representation for classes referee and ball, specifically for ball class is highly under-representation. How can we solve this imbalanced problem. Because your code is working on only the video you used. If we use use other videos from clips folder in DFL dataset, the result is not as expected. Below is method I tried but did not help: - manipulated ball and referee class instances in big part of dataset (1k image custom dataset by me) by excluding player class. However, this can decrease model performance (not recommended) After doing some research, I found that "loss weighting" method is suggested in this case which can be focused on certain class more. But I am not sure how it can be implemented for custom training. Is there anyone who has experience on this issue and solved. Could you share your experience? Thanks a lot in advance !!!
Wow another full project video with more than 4 hours? This is not the normal content on UA-cam. Thank you! I have a question. Do you have experience creating models for eye tracking?
I don't have work experience with eye tracking. But usually when you have your basics set then you can read some papers and articles about the topic and you will be on track on creating that I'm no time. Considering that it's not super hard.
Hi sir, can you please upload a video explaining anomalib library, there's none on the internet, you would be the first to upload it and can help many many people who want to use anomalib but can't due to it's tough documentation
Bolt reached a top speed of 43.99 kilometers per hour Bolt reached a top speed of 43.99 kilometers per hour but number 15 is at 45kmph and he is not even jogging at 0:04
Thanks for the video! Please keep making new ones :) I have a question regarding the "Player color assignment": Do you think using K-means will always cluster correctly team 1 vs team 2, background vs player shirt? Is it not possible that there is a combination of colors which may result into bad clustering? Did you think about some alternative ways to achieve the same purpose?
bro I just found ur video and I have no idea what you said means cuz I barely know about AI but damn this shit looks interesting. I'm working on it and will add it to my portfolio. Please continue doing these videos
if you could take a livestream - and then re-encode it to use a game engine to simulate the exact game and then broadcast that you would be able to use it for any football clips without copyright
Is it even possible to do it with a live match because camera angle changes quickly in that ?? I hope someone will reply this query instead of liking 😅 I want to know that it is even possible or not with some explanation!
could you make a project where we could tell the approximate distance from the camera through openCV, could use it for something like parking sensors etc.
Such a nice video. It really helps to understand the concept and way of working. I am wondering two things. Can pose estimation block be added on this ? Second , is there a way to project the players and the ball on a 2d plane to project the movement
00:03 Build a football analysis system using YOLO, OpenCV, and Python 02:27 The first step is detecting players and the ball in the video using YOLO model. 08:10 Implementing object detection using YOLO model for football analysis 11:03 Object detection involves identifying sports balls and mapping their position in the image. 16:44 Improving detection accuracy for sports ball and players 19:08 Utilizing Robo flow's football player detection image data set for AI/ML Football Analysis system training 24:22 Setting up and exploring football data set 27:03 Moving the data set to specific folders is crucial for training code to work 32:15 Training the AI model requires patience and 100 epochs 34:42 Evaluating the AI model with YOLO for football analysis. 39:47 Using OpenCV to read and save videos 42:25 Setting up an output video format and defining video parameters 47:52 Building a smart tracker for assigning the same entity to a bounding box across multiple frames. 50:49 Implementing a tracker to assign bounding boxes and IDs to track objects across frames 56:26 Setting minimum confidence level for object detection 59:00 Using bite tracker to override goalkeeper with player 1:05:02 Analyzing objects in football frames using YOLO and OpenCV 1:07:45 Replacing class IDs for more robust operation 1:13:09 Implement object tracking for players, referees, and ball 1:16:06 Implementing object tracking for football analysis 1:21:26 Saving and loading data using pickle in Python 1:24:18 Drawing circles to visualize predictions 1:30:20 Implementing functions to get center and width of bounding box in Python 1:33:05 Drawing an ellipse using CV2 function in Python 1:38:48 Implementing object tracking for players and referees 1:41:35 Defining X, Y, and XY positions for football analysis 1:46:49 Illustrating how to create a triangle pointer for tracking 1:49:29 Creating a triangle on top of the ball using OpenCV and Python 1:55:31 Implementing image cropping and saving in Python using OpenCV 1:58:35 Implementing bounding boxes and image cropping for football analysis with AI/ML 2:04:36 Implementing K-means clustering for image segmentation 2:07:32 Identifying player and non-player clusters using corner clustering 2:13:08 Creating a function to get player color and perform clustering. 2:16:04 Implementing K-means clustering for player color extraction 2:22:00 Identifying player team based on color and K-means clustering 2:24:34 Assigning players to teams and colors in AI football analysis system 2:30:30 Using team colors for player tracking in football analysis 2:33:10 Using pandas to interpolate missing ball positions for more complete detections. 2:38:46 Implementing ball tracking with YOLO and OpenCV 2:41:27 Creating a module for player-ball assignment logic 2:46:47 Assigning players to balls based on minimum distance calculation 2:50:00 Assigning player and ball control analysis 2:55:29 Drawing semi-transparent rectangles for football analysis system 2:58:29 Calculate percentage of time each team has the ball 3:04:46 Adjust camera motion to measure player speed accurately 3:07:24 Detecting corner features and analyzing camera movement 3:12:54 Setting up parameters for football analysis system initialization 3:15:38 Setting up feature extraction parameters for the AI/ML system. 3:20:58 Calculating distance between new and old feature points 3:23:54 Implementing camera movement analysis in AI/ML Football Analysis system 3:30:02 Implementing camera movement analysis in OpenCV 3:33:00 Building robust player positions in the football analysis system 3:38:33 Adjusting positions according to camera movement 3:41:10 Implementing camera movement estimator and view transformer for football analysis AI system 3:46:54 Understanding football field dimensions 3:49:40 Converting camera-adjusted positions to real-world positions for tracking speed and distance easily. 3:55:16 Implementing perspective transformation for AI/ML analysis 3:58:11 Creating a transformPoint function for perspective transformation. 4:04:28 Calculating speed using Python for project 4:07:40 Calculating speeds and distances of players in AI/ML Football Analysis 4:13:42 Calculate time elapsed, speed and total distance covered in AI/ML Football Analysis 4:16:40 Implementing speed and distance tracking for football analysis 4:22:48 Implementing speed and distance estimation in the main program 4:25:58 Creating AI/ML Football Analysis System with YOLO, OpenCV, Python Crafted by Merlin AI.
As a computer science student who is interested in ML and loves football, I see this video as an absolute win
same bro
I can relate as well 👌
fckin true
It's just a data science project and not ML
same bro
this must be the best youtube recommendation in my life
True
very true
Fact
Do you have the kaggle dataset?
did you even tried making it ? just askin
00:02 Build a football analysis system using YOLO, OpenCV, and Python
02:23 Setting up folders and initializing the YOLO model for object detection
08:06 Demonstration of AI/ML football analysis system using YOLO, OpenCV, and Python
10:59 Understanding object detection and bounding boxes in AI/ML football analysis
16:42 Improving detection accuracy and excluding non-relevant objects
19:05 Utilizing Roboflow's football player detection dataset
24:19 Setting up football data set for AI/ML analysis
26:58 Moving data sets to specific folders for code reproducibility.
32:11 Training progress and downloading model weights
34:36 Using YOLO, OpenCV, and Python to analyze football with AI/ML
39:43 Setting up video reading and saving utilities with CV2 library
42:21 Setting up output video format and writing frames to video writer
47:48 Implementing object tracking for player analysis using bounding boxes.
50:46 Implementing object tracking using YOLO and a specific tracker
56:22 Setting minimum confidence for object detection and addressing false detections
58:57 Implementing object tracking with YOLO and OpenCV
1:04:59 Using YOLO and OpenCV for object detection in football analysis
1:07:41 Implementing class detection and verification in AI/ML Football Analysis system
1:13:09 Tracking and extracting bounding boxes for players, referees, and ball in a football video.
1:16:03 Implementing object tracking for football analysis using YOLO and OpenCV
1:21:24 Saving and loading data using pickle in Python
1:24:15 Developing code to visualize the predictions using circles instead of bounding boxes
1:30:17 Extracting center and width of bounding boxes for football analysis.
1:33:01 Drawing an ellipse using CV2 function
1:38:45 Implementing AI/ML tracking for players and referees in football analysis
1:41:31 Calculating X and Y positions for the rectangle center
1:46:46 Implementing object tracking and drawing in AI/ML Football Analysis system.
1:49:27 Defining triangle points based on bounding box for AI/ML Football Analysis.
1:55:25 Developing a football analysis system with Python and OpenCV
1:58:30 Implementing image processing and analysis in Python using YOLO and OpenCV
2:04:30 Implementing K-Means clustering for image segmentation
2:07:28 Determining player and non-player clusters using color analysis
2:13:06 Implementing a clustering model using K-means algorithm
2:16:00 Implementing K Means clustering for player color detection.
2:21:57 Implement player team identification using player ID and color
2:24:30 Assign players to teams based on their colors
2:30:26 Utilizing team colors for player tracking
2:33:07 Using pandas to interpolate missing values for more complete detections
2:38:45 Implementing ball tracking and player assignment using YOLO and OpenCV
2:41:22 Creating a module for player ball assignment
2:46:46 Assigning players to balls using AI algorithm
2:49:58 Implementing tracking of players with assigned players and has ball attribute
2:55:26 Drawing semi-transparent rectangles for football analysis
2:58:26 Calculate the percentage of time each team has the ball
3:04:46 Adjusting for camera motion to accurately measure player speed and distance
3:07:19 Detecting corner features and camera movement using Optical flow
3:12:50 Initializing parameters for feature extraction in AI/ML Football analysis
3:15:35 Setting parameters for feature extraction and tracking in football analysis
3:20:52 Implementing a function to measure distance and camera movement
3:23:50 Implementing camera movement detection using YOLO and OpenCV
3:29:58 Implementing camera movement tracking and displaying on the frame
3:32:58 Implementing player positions robust to camera movement
3:38:31 Adjusting positions according to camera movement
3:41:06 Implementing camera movement estimator for position adjustment
3:46:52 Discussing the football court dimensions and calculations
3:49:36 Converting camera-adjusted position to real-world positions
3:55:14 Implementing perspective transform and transforming points
3:58:06 Implementing transform Point function for AI/ML Football Analysis system
4:04:24 Creating a speed and distance estimator using Python.
4:07:39 Calculating speeds and distances for players using object tracking
4:13:36 Calculating speed and distance in football analysis
4:16:42 Implementing speed and distance calculations for object tracking in AI/ML football analysis system
4:22:42 Implementing speed and distance estimator in the main program.
4:25:55 Building an AI/ML Football Analysis System with YOLO and OpenCV
Crafted by Merlin AI.
Thanks a lot for this effort
you are a legend brother.
Thanks a lot
Bro, where we get output and which format
Thanks a lot my man
Absolutely fantastic tutorial! As someone keen on integrating machine learning and sports analysis, this video is a goldmine. The way you've utilized technologies like YOLOv8, KMeans, and optical flow to analyze football gameplay is incredibly insightful. Your step-by-step guide on fine-tuning the object detection models and implementing perspective transformation to measure real-world movements is super helpful. Thanks for putting together such a comprehensive guide and for sharing all the resources and your GitHub repo. Can’t wait to dive in and try out some of these techniques on my own projects. Great work! 👏👏👏
Ikr.. can you imagine the potential for new systems 😂
Generating comments with ChatGPT?
it is a really quality project
This is just pure youtube gold. Fantastic! Thanks for this!
This is pretty cool! In a project I worked on a few years back we used a similar approach to create 3D simulations based on the data we gathered from the match broadcast. The project was used for the 2018 World Cup for a TV broadcaster in the US. Back then we relied a lot in approximation because the data was still very noisy. It's great to see progress in this field!
Can u show also this project?
Compared to the last project, you've done a better job of explaining things, wonderful jobs from you !!!
Thanks a lot for noticing those improvements 😃
@@codeinajiffy Yea, keeping up the good job!!!
@@codeinajiffy Hey! Can we use the model on any football input video ?
It show an value error: found array with 0 sample(s) (shape(0,3)) while a minimum of 1 is required by KMeans.
I wanted to make a script like this some days ago and this popped up on my feed, you're a genius.
Sometimes I'm surprised when UA-cam shows me what I thought. Really
Im guessing you think your a genius as well
Do you have the kaggle dataset?
@@abirehsanevan8977 its given in the description of the video, in the google drive link
One of the most underrated channel
I think you're doing a great job with these tutorials. I hope to see you grow into a massive youtuber
I hope so too. Thanks a lot. I appreciate that!
wow, I am just a freshman from Turkiye and these videos attract and inspire me so much, thank you for sharing your experience
Creating a video like this available for free and demystifying machine learning for beginners is amazing, thanks lad!
The fact that bro made the video in one shot is insane, mad focus brother you have got mashaAllah keep it up!
Wow .. one of the best channel for ML- Computer Vision guy
Tutorial looks insane and interesting even tough i'm not interested in machine learning i'm going to dive into this. Please keep up the good work with these tutorials!
This is a really value video! I got tons of insight from this tutorial! even though I'm not a machine learning engineer it definitely makes me find a door for entrance, subscribed!
The best video I've watched in UA-cam! Let's donate to help him to activate Windows!
Thank you sir, we never had this kind of projects out there!
wanna final yea mechanical engineer and football fan here, random UA-cam recommendation and undoubtedly one of the best. I absolutely despise coding but mate u had me glued to the screen. well done on an absolutely bonkers job. u earned my sub today
Its crazy how all your code logic worked first time and your only errors were spelling mistakes 🤣 Really great video
does this project work entirely for you?
i really wish i picked this for my alevels coursework, now i'm stuck with some architectural project where i cant even find a tutorial on it, this proect seems so straight forward
Great project. I can imagine it's real world use cases like displaying Distance covered, Maximum/Minimum/Avg Speed of players after a match.
Incredible job mate, we gotta make the resume shine
This is a gold mine. Thanks a lot
This tutorial is the best one I have seen so far. Thank you so much. Cheers!
great learning. I really enjoyed watching 4 hours long movie. I still need watch it again many times to get better hold of things. Please keep on keeping with this kind of analysis. Your teaching style is really simple and straight forward. 😇
JazakAllah brother. This is the best and most proper computer vision and deep learning project. Easy to follow and understand for all.
Uffff amazing video! You are a really super senior programmer, it's a pleasure to see you code in real time. Congratulations!!!🙌
My favorite video on UA-cam. Thanks for the great tutorial, this will be a game changer for me
You are a GOAT for doing this. Suggestion for the next video: Make a cricket ball trejectory analysis system.
I clicked ob the Video because of the topic and then i saw it´s my Favourite Football Club. Borussia Mönchengladbach 💚💚
"38.18 km/h
18.03 m" League record. BTW NICE WORK! 👏👍
So much topic covered.
Swift version for me please 😉✨
I am at 1:37:37 and when i run it, i get "list index out of range" for player_dict = tracks['players'][frame_num] in the draw_annotations function and I cannot figure out why
Great Project and Course may all learners succeed in their journey
is this project ML or DL ??
Xq
I so love this... I am a beginner in this field and I so love it. Thank you for Inspiring me.
Incredible video. I think some corrections are needed in the player' speed tracking. They seem to be overestimating the speed. Congratulations for such an incredible project!
This channel needs more attention. Good job!
Thank you so much for this video you are really humble that provides this types of videos for free because we invest so munch money to learn computer vision machine learning but its totally waste of money. Guys plz don't waste your money. You tube is really good platform to learn everything with free plz waste your time for searching and you will get gem youtube channel like this channel. I highly recommend that channel to my frds also
You got a like, that's for free. this type of content needs to be put out there, instead of misleading contents and reels.
I'm not into this type of content. but I know that it needed a lot of work.
Your videos are very detailed and step-by-step instructions. I really like them and thank you very much for your enthusiasm
this is incredible!!! dude I was looking for something to get me started into the world of AI and dang I just found the perfect project
20 minutes into this and Uff, I'll take an entire doctorate degree if you teaching it
1:13:50 frame_detection in detection_with_tracks
Do we agree that we loop on the objects, not on the frames
And great tutorial !!!
@@jonasinho6401 yes you are correct. And each index in theist of objects corelate to the frame index.
@@codeinajiffy sir can i get total output video please
Hi! Nice tutorial and incredible video. I want to ask if you think this approach is good for determining passes, shots on target, etc. I'm considering using a custom dataset and maybe other tools. Do you have any ideas?
What to do if i want to display kit number on top of every players?
To anyone stuck on the !yolo task=detect mode=train model=yolov5x.pt data={dataset.location}/data.yaml epochs=100 imgsz=640 part:
- Run the code below in a separate code line:
%env PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
- Switch the runtime from CPU to T4/TPU v4
I am stuck on that. I'm try running into google colab,but I am facing the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/trainer.py", line 517, in get_dataset
data = check_det_dataset(self.args.data)
File "/usr/local/lib/python3.10/dist-packages/ultralytics/data/utils.py", line 329, in check_det_dataset
raise FileNotFoundError(m)
FileNotFoundError:
Dataset 'football-players-detection-1/data.yaml' images not found ⚠, missing path '/content/datasets/football-players-detection-1/football-players-detection-1/valid/images'
Note dataset download directory is '/content/datasets'. You can update this in '/root/.config/Ultralytics/settings.yaml'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/yolo", line 8, in
sys.exit(entrypoint())
File "/usr/local/lib/python3.10/dist-packages/ultralytics/cfg/__init__.py", line 582, in entrypoint
getattr(model, mode)(**overrides) # default args from model
File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/model.py", line 654, in train
self.trainer = (trainer or self._smart_load("trainer"))(overrides=args, _callbacks=self.callbacks)
File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/trainer.py", line 130, in __init__
self.trainset, self.testset = self.get_dataset()
File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/trainer.py", line 521, in get_dataset
raise RuntimeError(emojis(f"Dataset '{clean_url(self.args.data)}' error ❌ {e}")) from e
RuntimeError: Dataset 'football-players-detection-1/data.yaml' error ❌
Dataset 'football-players-detection-1/data.yaml' images not found ⚠, missing path '/content/datasets/football-players-detection-1/football-players-detection-1/valid/images'
Note dataset download directory is '/content/datasets'. You can update this in '/root/.config/Ultralytics/settings.yaml'
this is the data.yaml content:
names:
- ball
- goalkeeper
- player
- referee
nc: 4
roboflow:
license: CC BY 4.0
project: football-players-detection-3zvbc
url: universe.roboflow.com/roboflow-jvuqo/football-players-detection-3zvbc/dataset/1
version: 1
workspace: roboflow-jvuqo
test: ../test/images
train: football-players-detection-1/train/images
val: football-players-detection-1/valid/images
raise SyntaxError(string + CLI_HELP_MSG) from e
SyntaxError: 'Analysis\training\football-players-detection-1/data.yaml' is not a valid YOLO argument. it`s dosnt work for me :(
and you can add batch=1 or =2 at the end incase of gpu run out of memory and immediatelly stop with ^C
this comment needs to be pinned
hey I tried doing it but I'm still stuck, it gives me this error but I'm sure that the missing path exists:
RuntimeError: Dataset '/content/football-players-detection-1/data.yaml' error ❌
Dataset '/content/football-players-detection-1/data.yaml' images not found ⚠, missing path '/content/football-players-detection-1/football-players-detection-1/valid/images'
Note dataset download directory is '/content/datasets'. You can update this in '/root/.config/Ultralytics/settings.yaml'
Quite fun, i was thinking how this would look like with my football club, when i noticed the video is from my club
I can't stop looking at "+36°C" in your toolbar. Scary.
It's interesting that the YOLO is not detecting sitting people aside the field.
I support this, keep working on this, I hope you can make big money by replacing the referees especially the PGMOL
what a great video of a full complete and intelligent project. Great job!
Gran trabajo, star en github , like y nuevo suscriptor en youtube, felicitaciones, saludos desde Argentina!!
I watched your video tutorials for Tennis and Football. I would love to see a tutorial for Basketball. Are you planning to do something like that?
My yolo8x is detecting random stuff like cats, benches. hotdogs etc? is anything wrong?
me too, did you find any solution to this?
@@minaa2811 you need to train the model
@@MitchellWillis-il7yk Train the model how? The dataset on kaggle isn't available to download now. He has put the single video he uses in the description but is just 1 video enough for training?
apparently if you are on windows without a gpu there is sometimes an issue. In a reddit post someone mentioned this and the solution is to downgrade pytorch (and also reinstall everything related to python). This fixed it for me
@@ahmedisbased watch the video he trains a model with the roboflow dataset, the kaggle dataset of test videos.
Fist of all, thank you so much for amazing tutorial. You are really genius. Your explanation is really excellent.
However, I have question related to dataset. From the nature of football analysis, we have imbalanced dataset, over-representation for player class and under-representation for classes referee and ball, specifically for ball class is highly under-representation. How can we solve this imbalanced problem. Because your code is working on only the video you used. If we use use other videos from clips folder in DFL dataset, the result is not as expected.
Below is method I tried but did not help:
- manipulated ball and referee class instances in big part of dataset (1k image custom dataset by me) by excluding player class. However, this can decrease model performance (not recommended)
After doing some research, I found that "loss weighting" method is suggested in this case which can be focused on certain class more. But I am not sure how it can be implemented for custom training.
Is there anyone who has experience on this issue and solved. Could you share your experience?
Thanks a lot in advance !!!
I totally agree with you, model is overfitting and on every other video from DFL dataset goes nuts
Hey Can you share the video clip as its not availible on kaggle now
When I try to put another input video of football it does not work why is that how can I make it work for every football video
Wow another full project video with more than 4 hours? This is not the normal content on UA-cam. Thank you! I have a question. Do you have experience creating models for eye tracking?
I don't have work experience with eye tracking. But usually when you have your basics set then you can read some papers and articles about the topic and you will be on track on creating that I'm no time. Considering that it's not super hard.
And for free. This is really what keeps me on youtube
This is actually impressive
Wow! We need more CV project from you, because they are so cool and usefull for learning DL
YOU'RE THE GOAT BRO I SWEAR TO GOD😭😭
As a football coach/player and software developer great video 👏
can you make like 5-10 min long summary video such as data points, sources, end result
What is this project useful for in football? Do you mind answering?
You can study lesions! Maybe it can predict that.
You could sell this to the EPL. This is really magnificent.
sir can you please make more end to end opencv yolo or LLM projects this was so good and best in the internet
Really a great video. Respect from the depth of my heart.
Legendary YT recomendation
Pure gem video and channel. That's whats I needed!
This will be crazy to use it on football gamble
can you doing same type analysis in the cricket match also ?
Thank you for this type of videos It really helps the community
Great Video! Next thing could be using this to train with reinforcement learning a FIFA bot. Would be amazing
That would be cool!
Hi sir, can you please upload a video explaining anomalib library, there's none on the internet, you would be the first to upload it and can help many many people who want to use anomalib but can't due to it's tough documentation
Bolt reached a top speed of 43.99 kilometers per hour Bolt reached a top speed of 43.99 kilometers per hour but number 15 is at 45kmph and he is not even jogging at 0:04
Thanks for the video! Please keep making new ones :)
I have a question regarding the "Player color assignment":
Do you think using K-means will always cluster correctly team 1 vs team 2, background vs player shirt? Is it not possible that there is a combination of colors which may result into bad clustering? Did you think about some alternative ways to achieve the same purpose?
bro I just found ur video and I have no idea what you said means cuz I barely know about AI but damn this shit looks interesting. I'm working on it and will add it to my portfolio. Please continue doing these videos
Thanks for putting this together!
does this work entirely for you?
Incredible tutorial. Very interesting. Very good job. COngratulations and thank you
If you made an update to this that used a livestream rather then video files you would be getting millions of views!
if you could take a livestream - and then re-encode it to use a game engine to simulate the exact game and then broadcast that you would be able to use it for any football clips without copyright
@@easydoggywhich game engine can do this simulation?
@@Magicallstore any 3d engine but id imagine it would be easy to use a game engine like football manager or fifa
Not only football, you could do it with any game
Is it even possible to do it with a live match because camera angle changes quickly in that ??
I hope someone will reply this query instead of liking 😅
I want to know that it is even possible or not with some explanation!
This video so amazing. Well done 👍 👏 @Code In a Jiffy. I really love your work. God bless you
You can do more about tracking on the minimap?
did you get a response?
@@crasx16 I haven't received it yet, are you in need?
could you make a project where we could tell the approximate distance from the camera through openCV, could use it for something like parking sensors etc.
Thank you so much for sharing your experience and knowledge, Sir.
where to get the data from for training ??? as the original uploader has removed the data
youtube video description ____________
Hello. The dataset is no longer available in kaggle
Rip
what do the numbers for the plqyer mean? because they dont match up with the shirt number.
it is the accuracy of the measurement I guess meaning 1=100% and 0=0% accuracy
Is it possible for someone to send me a drive link that contains the video used as an input since I found the DFL dataset empty?
The dataset is no longer available on kaggle. Any idea where I can find it so that I can follow along?
Same problem here
same
search "DFL Bundesliga 460 MP4 Videos in 30Sec. + CSV"
@@emrecs check my reply for this
@@alvarotovar5855 check my reply below for the dataset
I love to see this kind of tutorial. I appreciate your content
great man,,,we want more project like this with streamlit application.
This is a gem of a project wow!!!
Thank you so much
The font size in the video is too small making it difficult to read and follow. The topic is perfect.
Have you finished the project? Does it work without errors?
Such a nice video. It really helps to understand the concept and way of working. I am wondering two things. Can pose estimation block be added on this ? Second , is there a way to project the players and the ball on a 2d plane to project the movement
Another great video. That too, for free. Thank you once again.
ill do this course when I have a good computer
Amazing! Hope to see more videos like this one :)
No way you made this, I couldnt even make this with a tutorial
00:03 Build a football analysis system using YOLO, OpenCV, and Python
02:27 The first step is detecting players and the ball in the video using YOLO model.
08:10 Implementing object detection using YOLO model for football analysis
11:03 Object detection involves identifying sports balls and mapping their position in the image.
16:44 Improving detection accuracy for sports ball and players
19:08 Utilizing Robo flow's football player detection image data set for AI/ML Football Analysis system training
24:22 Setting up and exploring football data set
27:03 Moving the data set to specific folders is crucial for training code to work
32:15 Training the AI model requires patience and 100 epochs
34:42 Evaluating the AI model with YOLO for football analysis.
39:47 Using OpenCV to read and save videos
42:25 Setting up an output video format and defining video parameters
47:52 Building a smart tracker for assigning the same entity to a bounding box across multiple frames.
50:49 Implementing a tracker to assign bounding boxes and IDs to track objects across frames
56:26 Setting minimum confidence level for object detection
59:00 Using bite tracker to override goalkeeper with player
1:05:02 Analyzing objects in football frames using YOLO and OpenCV
1:07:45 Replacing class IDs for more robust operation
1:13:09 Implement object tracking for players, referees, and ball
1:16:06 Implementing object tracking for football analysis
1:21:26 Saving and loading data using pickle in Python
1:24:18 Drawing circles to visualize predictions
1:30:20 Implementing functions to get center and width of bounding box in Python
1:33:05 Drawing an ellipse using CV2 function in Python
1:38:48 Implementing object tracking for players and referees
1:41:35 Defining X, Y, and XY positions for football analysis
1:46:49 Illustrating how to create a triangle pointer for tracking
1:49:29 Creating a triangle on top of the ball using OpenCV and Python
1:55:31 Implementing image cropping and saving in Python using OpenCV
1:58:35 Implementing bounding boxes and image cropping for football analysis with AI/ML
2:04:36 Implementing K-means clustering for image segmentation
2:07:32 Identifying player and non-player clusters using corner clustering
2:13:08 Creating a function to get player color and perform clustering.
2:16:04 Implementing K-means clustering for player color extraction
2:22:00 Identifying player team based on color and K-means clustering
2:24:34 Assigning players to teams and colors in AI football analysis system
2:30:30 Using team colors for player tracking in football analysis
2:33:10 Using pandas to interpolate missing ball positions for more complete detections.
2:38:46 Implementing ball tracking with YOLO and OpenCV
2:41:27 Creating a module for player-ball assignment logic
2:46:47 Assigning players to balls based on minimum distance calculation
2:50:00 Assigning player and ball control analysis
2:55:29 Drawing semi-transparent rectangles for football analysis system
2:58:29 Calculate percentage of time each team has the ball
3:04:46 Adjust camera motion to measure player speed accurately
3:07:24 Detecting corner features and analyzing camera movement
3:12:54 Setting up parameters for football analysis system initialization
3:15:38 Setting up feature extraction parameters for the AI/ML system.
3:20:58 Calculating distance between new and old feature points
3:23:54 Implementing camera movement analysis in AI/ML Football Analysis system
3:30:02 Implementing camera movement analysis in OpenCV
3:33:00 Building robust player positions in the football analysis system
3:38:33 Adjusting positions according to camera movement
3:41:10 Implementing camera movement estimator and view transformer for football analysis AI system
3:46:54 Understanding football field dimensions
3:49:40 Converting camera-adjusted positions to real-world positions for tracking speed and distance easily.
3:55:16 Implementing perspective transformation for AI/ML analysis
3:58:11 Creating a transformPoint function for perspective transformation.
4:04:28 Calculating speed using Python for project
4:07:40 Calculating speeds and distances of players in AI/ML Football Analysis
4:13:42 Calculate time elapsed, speed and total distance covered in AI/ML Football Analysis
4:16:40 Implementing speed and distance tracking for football analysis
4:22:48 Implementing speed and distance estimation in the main program
4:25:58 Creating AI/ML Football Analysis System with YOLO, OpenCV, Python
Crafted by Merlin AI.
JazakAllah for this
This is a genius level work!!