简体   繁体   English

创建检测卡片值的 ML 模型

[英]Creating an ML-Model that detects card-values

This is a more generic question about training an ML-Model to detect cards.这是一个关于训练 ML 模型来检测卡片的更通用的问题。

The cards are a kid's game, 4 different colors, numbers and symbols.这些卡片是儿童游戏,4 种不同的 colors、数字和符号。 I don't need to detect the color, just the value (aka symbol) of the cards.我不需要检测颜色,只需检测卡片的值(又名符号)。

I tried to take pictures with my iPhone of every card, used RectLabel to draw the rectangles around the symbols in the upper left corner (the cards have an upside down-symbol in the lower right corner, too, I didn't mark these as they'll be hidden during detection).我尝试用我的 iPhone 为每张卡片拍照,使用 RectLabel 在左上角的符号周围绘制矩形(卡片的右下角也有一个倒置的符号,我没有将这些标记为它们将在检测过程中被隐藏)。 I cropped the images so only the card is visible, no surroundings.我裁剪了图像,因此只有卡片可见,没有周围环境。

Then I uploaded my images to app.roboflow.ai and let them do their magic (using Auto-Orient, Resize to 416x416, Grayscale, Auto-Adjust Contrast, Rotation, Shear, Blur and Noise).然后我将我的图像上传到 app.roboflow.ai 并让它们发挥作用(使用自动定向、调整为 416x416、灰度、自动调整对比度、旋转、剪切、模糊和噪声)。

That gave me another set of images which I used to train my model with CreateML from Apple.这给了我另一组图像,我用它们来训练我的 model 和 Apple 的 CreateML。

However, when I use that model in my app (I'm using the Breakfast Finder Demo from Apple), the cards values aren't detected - well, sometimes it works, but only at a certain distance from the phone and the labels are either upside down or sideways.但是,当我在我的应用程序中使用 model 时(我使用的是 Apple 的早餐查找器演示),未检测到卡值 - 嗯,有时它可以工作,但仅在与手机有一定距离时,标签是倒置或侧身。

My guess is this is because my images aren't taken the way they should be?我的猜测是这是因为我的图像没有按照应有的方式拍摄?

Any hints on how I'd have to set this whole thing up so my model gets trained well?关于我必须如何设置整个事情以便我的 model 得到良好培训的任何提示?

My bet would be on this being the problem:我敢打赌这是问题所在:

I cropped the images so only the card is visible, no surroundings我裁剪了图像,所以只有卡片可见,没有环境

You want your training images to be as similar as possible to the images your model will see in the wild.您希望您的训练图像与 model 在野外看到的图像尽可能相似。 If it's trained only on images of cards with no surroundings and then you show it images of cards with things around them it won't know what to do.如果它只在没有周围环境的卡片图像上进行训练,然后你向它展示带有周围事物的卡片图像,它将不知道该怎么做。

This UNO scoring example is extremely similar to your problem and might provide some ideas and guidance.这个UNO 评分示例与您的问题非常相似,可能会提供一些想法和指导。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM