How to make your Reachy plays tic-tac-toe

Hi,
Thanks for the npz files : it’s works fine :clap:
We currently go on updating the tictactoe program from reachy 2019 to 2021 version.
We took this notebook Here to test the classification (with some adaptations for 2021 :grinning:):
The problem now is that with the ttt-boxes.tflite file (from tictactoe 2019) we have poor classification results :
image
Should we retrain the model ?

1 Like

Great to know you’re getting close!

Yes you should re train your model, the model that we used was trained to detect our wood pieces on a cork board, so it’s not surprising that it is not working well here :slightly_smiling_face:
The tutorial to retrain your model can be found where you found the notebook, here.

1 Like

Hi :wave:

Some news about the update of tictactoe game for Reachy2021 and the classification conducted during my summer 2021 internship at ENSAM Bordeaux.

I have changed the strategy for the recognition of the game pieces: we now use Objet Recognition algorithms to detect 3 types of objects:

  • cubes
  • cylinders
  • empty case.

The main advantages of this algorithm is to give both:

  • the nature of the detected object (cube/cylinder/empty)
  • the associated bounding box.

By processing the bounding box data we can now compute where the detected object lies on the grid:

imageDetection

This approach avoids to cut the image into 9 small images (one for each box of the grid) and classify the 9 images, which is a bit fragile due to the difficulty to get the head precisely positioned :face_with_head_bandage:.

You can see this video showing real time object detection performance of our solution.

We have used Tensorflow 1 Object Detection API which is compatible with the Reachy edgeTPU processor. More details will be posted soon as a gitHub repository, including the all the procedure to train the model with a customized data set.

We will also publish soon the new tictactoe repository for Reachy 2021.

3 Likes

Great work! Can’t wait for the code to try on our own Reachy.

The repository for the new tictactoe for Raeachy 2021 will be available in september… still some fine-tuning to do…
In particular, concerning the processing of the objects bounding boxes to compute where to position them on the grid, @simon can you specify us the refererence frame and the position of the grid squares that is used to pass the flattened board to the rm_agent.value_actions function?

Hi @Jean_Luc,
The grid squares are defined in the board_cases array in vision.py and the frame used to get the board configuration is recovered in the analyse_board method of tictactoe_playground.py.

Hope it is what you wanted!

Hi @Thea and @Jean_Luc,
Any updates on how is it going? :blush: