机器学习 缺陷检测
🚩 目标 (🚩Objective)
We want to evaluate the quickest way to detect the ball in a sport event in order to develop an Sports AI without spending a million dollars on tech or developers. Quickly we find out that detecting the ball is key component to develop a robust Sports AI.
我们想要评估一种在体育赛事中检测球的最快方法,以便开发出一款运动型AI,而无需在技术或开发人员上花费一百万美元。 很快我们发现,检测球是开发强大的Sports AI的关键组成部分。
(I’m not the technician on my team meaning the point of view provided in this post won’t take you deep into any algorithm or neural network).
(我不是团队的技术人员,这意味着本文中提供的观点不会带您深入任何算法或神经网络)。
🚩 你为什么要关心? 为什么要球? (🚩Why should you care? and Why the ball?)
If you are in the AI Sports niche is totally relevant for you to know the state of the art in ball detection, this object is always the main center of attention of any sport. If you can detect the ball (even at high speeds) then you will be able to detect easier key events of the game, metrics and so much more useful information.
如果您位于AI Sports领域,那么 与 您 了解球检测的最新技术 完全相关 ,那么此对象始终是任何运动的主要关注中心。 如果您能够(甚至在高速时)检测到球,那么您将能够检测到更简单的游戏关键事件,指标以及更多有用的信息。
the球员呢? (🚩What about the players?)
Having a successful Sports AI is a result of a well done computer vision set of detections, nowadays there are many available neural networks good at detecting human bodies (like OpenPose for example) so players will be easy to detect but not so the ball.. even less at high speeds… That's why we created this post to take evaluate the quickest way possible to ball detection.
拥有出色的运动AI的原因是计算机视觉检测功能的完善, 如今,有许多可用的神经网络擅长检测人体(例如OpenPose),因此玩家很容易检测到球而不是球。甚至在高速情况下也是如此……这就是为什么我们创建此帖子以评估最快的测球方法的原因。
Only being able to detect the ball won't take you there but we believe with a good ball detector alongside the actual people detector from pre-trained neural networks is the quickest way to start.
仅能够检测到球并不能带您到那里,但是我们相信,将优质的球检测器与预训练的神经网络中的实际人检测器一起使用是最快的入门方法。
简介:跟踪和检测运动对象 (Introduction: Tracking and Detecting Moving Objects)
As we stated before detect and track moving objects are key tasks for an AI in order to succeed in and thrive in this niche. Sports is equivalent to motion, people and objects moving in different speeds and directions.
如前所述, 检测 和 跟踪移动物体是AI的关键任务,以便成功地在这一小众市场中发展和繁荣。 运动等同于运动,人和物体以不同的速度和方向运动。
The capability to track moving objects and analyze them plays a crucial role. For us to develop and teach an AI to to watch a football game and detect elements or events from the match sounds like an easy task but its is actually very challenging..
跟踪运动物体并对其进行分析的能力起着至关重要的作用。 对于我们来说,开发和教导AI观看足球比赛并从比赛中检测元素或事件听起来像是一件容易的事,但这实际上是非常艰巨的。
有以下两个原因: (Here are a couple of reasons:)
- The camera is constantly panning, zooming and sometimes tilting and sometimes a replay appears from a radical different angle and our brains are SO good at negating this motion that we don’t even notice it. 相机不断摇摄,变焦,有时倾斜,有时从根本不同的角度出现重放,我们的大脑非常擅长否定这种动作,甚至我们都没有注意到。
- The amount of objects and people moving in every direction with different speeds and sometimes unpredictable trajectories 以不同的速度甚至有时无法预测的轨迹朝各个方向移动的物体和人员的数量
- The background mixing with players and ball, objects and people with nearly identical appearance 背景与球员和球,物体和人物相融合,外观几乎相同
- False positives, same objects outside the game (Players with the same outfit on the benches, sports balls outside the game identical to the ball “in game”) 误报,游戏外相同的物体(球员在板凳上穿着相同的衣服,游戏外的运动球与“游戏中”的球相同)
But we humans are magnificent at this tasks! We as humans negate effectively the camera movement that's why we don't get confused between the background and playing field for example…
但是我们人类在这项任务上是伟大的! 作为人类,我们有效地消除了摄像机的运动,这就是为什么我们不会在背景和运动场之间感到困惑的原因……
Or get lost in the rapid and sometimes erratic movement of people (players) and objects (ball, net, etc.) for an AI to compete with a human is difficult.
或由于人(玩家)和物体(球,网等)的快速,有时不稳定的运动而迷失, 很难使AI与人类竞争。
让我们开始 ! -我的探球之旅 (Let’s begin ! — My journey into ball detection)
My objective was to try out the ball detectors I come across within 5 hours of research in Google to let this experiment very plain and without an insider view of the AI industry.
我的目标是尝试在Google进行研究的5个小时内尝试碰到的球探测器,以使该实验非常简单,并且不了解AI行业。
To make this I use a “plug and play” approach, I don’t modify the code of the detectors and neural networks I find, I just download and run it with my local example with only minor modifications.
为此,我使用“即插即用”方法,我不修改发现的检测器和神经网络的代码,我只是通过本地示例下载并运行它,而仅做了少量修改。
I successfully want to track the ball on the following video, for sure my expectations were not too high, I’m aware the ball moves incredible fast..
我成功地希望在以下视频中跟踪球,确保我的期望不是太高,我知道球的移动速度令人难以置信。
让我们来看看发生了什么!! (Let’s see what happened!!)
This is the video I will use to analyze with 3 options of ball detectors.
这是我将使用3种球探测器选项进行分析的视频。
1st — PyImageSearch,OpenCV球检测器 (1st — PyImageSearch, OpenCV ball Detector)
¡TOO GOOD TO BE TRUE! ¡ first result on my search!📹 Running on CPU at 32fps 🤯✅ Realtime capabilities.
难以置信! ¡我搜索的第一结果! on以32fps在CPU上运行📹实时功能。
Reference Link Source Code:https://www.pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/
参考链接源代码: https : //www.pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/
This PyImageSearch article describes a very naive method to detect and track the tennis ball: just look for a green region on the image, and then find the enclosing circle for that region. Easy!
这篇PyImageSearch文章描述了一种非常幼稚的方法来检测和跟踪网球:只需在图像上寻找绿色区域,然后找到该区域的包围圈。 简单!
The reported results show the ball was actually very well tracked, even if was partially occluded from view by the hand It does even run at 32 FPS, which is insanely high and allows for real-time detection.
报告的结果显示,即使被手部分挡住了球,实际上也能很好地追踪到它。它甚至以32 FPS的速度运行,该速度实在太高了,可以进行实时检测。
So far so good, fits perfectly my needs so i needed to give it a try on my video!
到目前为止,一切都很好,完全可以满足我的需求,因此我需要尝试一下我的视频!
这是应用此检测器的结果。 (This was the result of applying this detector.)
Small clarification here: We did change the color detector from green to white in order to try to detect soccer ball because was set to green.
这里的一些澄清: 我们确实将颜色检测器从绿色更改为白色,以便尝试检测足球,因为将其设置为绿色。
Didn’t worked at all, it got confused with other white objects on the screen and the ball was never detected or tracked.
根本不起作用,它与屏幕上的其他白色物体混淆,并且从未检测到或跟踪到球。
第二个DETECTRON2(来自Facebook的预训练神经网络) (2nd DETECTRON2 (Pre-Trained Neural Network From Facebook))
📹 Running on GPU (Nvidia GTX 1060Ti 6Gb Ram) at 2 fps, ❌ Not real time capability
on以2 fps在GPU(Nvidia GTX 1060Ti 6Gb Ram)上运行, 📹 非实时功能
Reference Link Source Code: https://nol.cs.nctu.edu.tw:234/open-source/TrackNet/
参考链接源代码: https : //nol.cs.nctu.edu.tw : 234/ open-source/ TrackNet/
In this second option I will try to implement a neural network provided by Facebook already pre-trained with tons objects (including Sports balls). I was really intrigued about the “out of the box” result. Also, I wanted to see if it was going to be capable of detecting the players bodies.
在第二个选项中,我将尝试实现一个由Facebook提供的神经网络,该神经网络已经预先训练过吨物体(包括运动球)。 我对“开箱即用”的结果很感兴趣。 另外,我想看看它是否能够检测玩家的身体。
这是应用此检测器的结果: (This was the result of applying this detector:)
The players were all perfectly detected that is a point in favor for Detectron2. About the ball, it got detected in a few frames but was the first time I saw it detected!
所有人都被完美检测到 ,这是对Detectron2的支持。 关于球,它在几帧后就被检测到了,但这是我第一次看到它被检测到!
We find out that when the ball is in still position it is able to be detected by Detectron2 and with a high confidence score.
我们发现, 当球处于静止位置时,它可以被Detectron2 检测到并且具有很高的置信度。
But this pretrained neural network has problems with fast moving objects like the ball.
但是,这种经过预训练的神经网络在球等快速移动物体方面存在问题 。
This led me to the last experiment with a custom tracker specially solving the fast moving objects based on heatmaps this next development is promising because the nearly perfect detections on tennis (which is a smaller ball and moves faster!)
这使我进入了最后一个实验,该实验是使用定制跟踪器基于热图专门解决快速移动的对象的,因此下一个发展很有希望,因为网球上的检测几乎是完美的(较小的球,移动速度更快!)
第三轨道网 (3rd TrackNet)
📹 Inside the documentation specify that it was able to run at 22fps! Allowing Real Time Capability BUT was not so correct.. On my GPU (Nvidia GTX 1060Ti 6Gb Ram) it ran at 2 fps..❌ Not real time capability.
📹在文档中指定它能够以22fps运行! 允许实时功能BUT并不是那么正确。在我的GPU(Nvidia GTX 1060Ti 6Gb Ram)上, 它以2 fps的速度运行 。❌ 不是实时功能。
Reference Link Source Code: https://nol.cs.nctu.edu.tw:234/open-source/TrackNet/
参考链接源代码: https : //nol.cs.nctu.edu.tw : 234/ open-source/ TrackNet/
This one was my best candidate for Ball Tracking even though the detection was on tennis I was confident that it could be easier to detect a ball that is bigger in size and never travel with that much speed, but…
即使是在网球上进行检测,这也是我最好的跟踪球的人选, 我坚信检测更大尺寸的球并且永远不会以如此快的速度行驶可能更容易,但是……
应用此检测器的结果: (The result of applying this detector:)
I was wrong, the result was bad… Even though the detection of the soccer ball improve comparing to the PyImageSearch detector, there are too many false positives on the frames… meaning that TrackNet detects the ball even where there is not a ball at all…
我错了,结果很糟糕 ……尽管与PyImageSearch检测器相比,足球的检测有所改善,但帧上的误报过多……这意味着即使在根本没有球的情况下,TrackNet也会检测到球……
Additionally this ran at 2 fps not the 22 fps that were mention on the documentation, this blocks the possibility to analyze and detect at realtime.
此外, 该文件以2 fps的速度运行,而不是文档中提到的22 fps ,这阻止了实时分析和检测的可能性。
One big advantages is that this TrackNet neural network have very good documentation and advice in how to train with your own data. This could be a solution to solve the ball detection on soccer, but it’s clearly not an easy task.
一大优势是,该TrackNet神经网络在如何使用自己的数据进行训练方面具有非常好的文档和建议。 这可能是解决足球球检测的一种解决方案,但这显然不是一件容易的事。
If anyone has a dataset of soccer balls (real and/or synthetic) we are interested in collaboration to train this neural network or develop a custom solution write an email to us at gcor@eidos.ai
如果有人拥有足球(真实和/或合成)数据集,我们有兴趣合作训练该神经网络或开发定制解决方案,请写信给我们,电子邮件为gcor@eidos.ai
结果结论 (CONCLUSION FROM THE RESULTS)
In conclusion no “plug and play” neural network will take you all the way there in AI Sports, there is no global solution (YET) in this niche. This makes an incredible advantage for those who jump in this space early and develop a global solution. This is yet to come..
总之,在AI Sports中,没有“即插即用”神经网络会带您一路走,在这一细分市场中没有全局解决方案 ( YET )。 对于那些早日涉足这一领域并开发全球解决方案的人来说,这具有不可思议的优势。 这还没有来。
But, even though there’s not a global solution, each different situation can be solved with different methods, creating custom solutions adapted for each problem.
但是,即使没有全局解决方案,也可以使用不同的方法解决每种不同的情况,从而创建适合每个问题的定制解决方案。
That’s why you will need to contact a team to develop this type of AI.
这就是为什么您需要联系团队来开发这种类型的AI的原因。
If you are interested on collaborate or build your AI with us.
如果您有兴趣与我们合作或构建您的AI。
Reach out!
伸手!
We are an Software agency focused on Machine Learning and specifically Computer Vision you can contact us at info@eidos.ai our website is https://eidos.ai
我们是一家专注于机器学习(尤其是计算机视觉)的软件代理商,您可以通过info@eidos.ai与我们联系。我们的网站是 https://eidos.ai
Stayed tuned for our next post on medium next month!
请继续关注我们下个月中发布的下一篇文章!
翻译自: https://towardsdatascience.com/ball-detection-with-computer-vision-ai-in-sports-f9ef743e0ef1
机器学习 缺陷检测
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/389449.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!