Previously I tried this using p-hashes but those didnt work quite well when units stood on tiles. So this time I tried it with MobileNet for embeddings + KNN for classification. So now doesnt need training and can learn from few examples and runs entirely in the browser.
It's a bit rough around the edges but works well enough that it generalizes to other hex games (tested on some Civilization screenshots too). Lots more that could be done - better UI, model persistence, maybe regression for tile yields - but it was a fun learning project. I also found the best way for me to learn more of the advanced ML concepts was just to build it for something I found fun.
Demo: https://buildmage.com/demos/weemap-scanner/ Source: https://github.com/panyam/weemaps/tree/main/part2-scanner