Recognizing Playing Cards

Okay, time to begin a project I've been putting off all year.

I've got a table of already computed values, and an already trained model for object detection in images. Time to start having some fun.

Poker probabilities for various starting hands and a given amount of players
Found this image online and I will use it as a test image
Ran the test image through the neural network model for detecting the cards
These are the predictions that came out of using the model.

The results are pretty disappointing. However, what's more disappointing is that it took about 30 seconds to go through this one image. Now that just won't do.

This seems like a computation better suited for my Lenovo Y500, rather than my Dell Latitude. I'm going to use one of the Y500's GPUs rather than just a CPU from the Latitude. I have no idea how much faster it will be. Let's find out!

Oh no!

I got an out of memory error when I tried to get this running on my other laptop. I wasn't sure what was happening until I read more into the issue.

Thanks hjchai!

Seems as though most every laptop GPU doesn't have enough memory to do this. I think I will need to use a desktop GPU. 4Gb might be enough but 2Gb is probably not enough. Someone suggested to me that I try using AWS or GCP for this instead of my laptop. That seems like a solid next step to try because I don't have a desktop GPU with more than 2Gb of memory.

After some quick pricing, it seems relatively not worthwhile to setup an instance through AWS or GCP for this project. Also, it occurred to me that my brother has a GPU that I could use on his computer. I believe he has 8-11GB on that card and it is a Nvidia card. This project will be continued on a later post.

The goal of this project is to be able to eventually multi-table online poker and get prompts of when a table has been dealt a good starting hand. What I have in my head is a heads up display that lays on-top of the tables. Gives relevant starting chance and color based text on an arbitrary cutoff determined by the user.

Count players and recognize starting hand to figure out chance of winning with the hand.

Multi-tabling allows to see more hands in an hour. This increases the chances of seeing those pocket aces that show up once every 221 hands. Anyone who has multi-tabled online poker knows it can be challenging. It's mostly professional players who multi-table. This project isn't meant to make money by playing online poker but is just a fun side project. It will help me get better at poker. This will be continued on a later post.