機器學習 缺陷檢測
🚩 目標 (🚩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.pswp.cn/news/389449.shtml 繁體地址,請注明出處:http://hk.pswp.cn/news/389449.shtml 英文地址,請注明出處:http://en.pswp.cn/news/389449.shtml
如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!