Neural Net capabilities aren't inherently in the Reachy framework but it can be added using a Coral Edge TPU. reachy-tictactoe is an example of how this is done.
The Reachy instance gets initialized here:
def __init__(self):
logger.info('Creating the playground')
self.reachy = Reachy(
right_arm=RightArm(
io='/dev/ttyUSB*',
hand='force_gripper',
),
head=Head(
io='/dev/ttyUSB*',
),
)
self.pawn_played = 0
Two models are used for tic tac toe, one to detect the state of the board and one to detect if the board is valid.
boxes_classifier = ClassificationEngine(os.path.join(model_path, 'ttt-boxes.tflite'))
boxes_labels = dataset_utils.read_label_file(os.path.join(model_path, 'ttt-boxes.txt'))
valid_classifier = ClassificationEngine(os.path.join(model_path, 'ttt-valid-board.tflite'))
valid_labels = dataset_utils.read_label_file(os.path.join(model_path, 'ttt-valid-board.txt')
The two models are based on mobilenet image model and they are fine tunes through transfer learning. The models are encapsulated with Coral's Imprinting Engine. The models are trained using the following Jupyter Notebook:
pollen-robotics/reachy-tictactoe
Detects whether or not a box has an X or an O or is empty. This classifier is used with identify_box() and get_board_configuration().