fir is known for accurate recognition of Foxhole stockpile information.
Given a map-view screenshot of any stockpile, the following are extracted:
- Structure name (i.e. Seaport, Bunker Base, etc.)
- Stockpile name (for private stockpiles)
- Structure technology (i.e. bunker garrison upgrade status)
- Stockpile contents (each item and quantity)
- Pixel boundary information for each of the above (i.e. if you want to display or highlight part of the image)
All common (and most other) icon mods are supported.
The goal is 100% accuracy, so please share any problematic screenshots via Discord or GitHub!
At https://fir.gicode.net/, stockpile screenshots can be compiled into visual reports and exported to machine-readable formats.
The website can be used to process screenshots and append to a Google Spreadsheet.
Multiple alternate spreadsheets exist.
Note: the sundial spreadsheet sidebar integration is currently broken and needs a maintainer. However, the website can be used to import into that sheet as well.
See includes/debug.js for a relatively succinct example.
Runs on at least Windows and Linux.
$ ./fic http-server 127.0.0.1:8000
Listening on http://127.0.0.1:8000
127.0.0.1:54422 POST /extract 200 61.317955ms
127.0.0.1:50236 POST /extract 200 56.144978ms
127.0.0.1:50252 POST /extract 200 54.504678ms$ curl -v --data-binary @<image-file> http://localhost:8000/extract
{ ...stockpile-json... }Runs on at least Windows and Linux.
$ ./fic extract <image-file>...
[{ ...stockpile-json... }]The companion is a single executable file that can be run without any other dependencies.
cd native
cargo build --release --bin fic
target/release/fic http-server 0.0.0.0:8000If you'd like to run it in Docker, here are some example commands.
podman build -f Dockerfile.companion -t fir_companion .
podman run -it --rm --init -p 8000:8000 fir_companion http-server 0.0.0.0:8000The static files in the repo are all you need, so you can host with any webserver you like. Some examples are below.
cd fir
python3 -m http.serverTo build the docker container run:
docker build -f Dockerfile.server --tag 'fir_server' .If you'd like to override the override the port the server listens on run:
docker build -f Dockerfile.server --build-arg PORT=<override port> --tag 'fir_server' .To run the fir server in the built docker continer:
docker run -p <host port>:<fir port> fir_serverThe -p argument maps the host port to the fir server port inside the container. fir defaults to listening on port
8000.
Standalone website:
cd fir
python3 -m http.serverTo build the google spreadsheet sidebar, run ./sundial/gs-build.sh and find the files to be added to Google Apps Script in ./sundial/gs-build.
The training process is somewhat complex. If you are interested in running the training, please reach out on Discord for more information.
The standalone method will require you to manually install all the necessary dependencies, such as Node, NPM, TensorFlow, etc.
To begin training, simply run build.sh <FModel-Data-Directory>.
Training can also be performed using a Docker container instead. [https://docs.docker.com/desktop/features/wsl/] If you plan to use your GPU(s) for training, you will need to install NVIDIA drivers and the NVIDIA Container Toolkit. [https://docs.nvidia.com/ai-enterprise/deployment/vmware/latest/docker.html]
Build the docker container by running docker docker build -f Dockerfile.trainer --tag 'fir_trainer' .
If you only want to utilize your CPU for training, run docker run -it --rm -v $PWD:/tmp -w /tmp -e WAR_LOCATION=<FModel-Data-Directory> fir_trainer
If you want to utilize both your CPU and GPU(s) for training, run docker run --gpus all -it --rm -v $PWD:/tmp -w /tmp -e WAR_LOCATION=<FModel-Data-Directory> fir_trainer
All original source code and contributions available under MIT License.
Catalog details and icons processed from the game Foxhole (created by Siege Camp) are made available only under Fair Use.
