You can find a more detailed write-up about this project here.
I decided to go with a single module play.py
so that it's more easily hackable to your needs.
Make sure to install the package manager uv, and it will take care of installing all the necessary python dependencies the first time you run the script.
Since a video recording will be made, you'll also need ffmpeg
installed locally (can be done via
brew, ...).
You can then run a pong episode (first player to reach 21) with the trained RL agent using:
uv run play.py
It will record an episode and save it in the same folder.