Add optional DirectML inference for Hecate 9.6 µm on Windows
This makes GPU-accelerated Hecate ink detection usable on a 16 GB Windows laptop with integrated graphics and shared system memory. The tested 9.6 µm prediction path needs neither a discrete GPU nor rented GPU compute.
I developed this while exploring PHerc0139 and PHerc0813 on a Ryzen 5 8540U laptop. Its Radeon 740M is the processor's integrated GPU. The released CUDA path cannot use that hardware on Windows; the optional DirectML helper lets the existing graphics hardware run the unchanged model.
The benefit is access to faster local experimentation for contributors who have a laptop but no dedicated GPU. They can test rendered regions and depth choices without first obtaining another computer or cloud GPU time. On this machine, the same real PHerc0139 96×96 field took 13.02 s on CPU and 3.54 s on integrated graphics: 3.68× faster, with all 9,216 image pixels identical. Timings include prediction and blending after model/session loading.
Reversed depth, padded edges and empty-column checks also matched exactly. Repeated GPU output and the Zarr-to-PNG command matched the array result. CPU fallback is disabled, and the execution profiles contain only DirectML dispatches.
The helper accepts standard uint8 ZYX surface-volume Zarr or .npy input and writes the existing probability PNG format. It reuses Hecate's volume reader, tile origins and PNG writer. Dependencies are optional; the existing hecate.py is unchanged.
Instructions, measurements and pixel comparison. The example downloader reconstructs the exact test input from four hash-checked official chunks; scan data and weights are not redistributed.
Validated scope: Windows 11, Radeon 740M integrated graphics, 16 GB shared RAM, Hecate 9.6 µm, FP32, batch one, 2D output. Developed and tested with Codex. Hecate's model and weights remain credited to the Vesuvius Challenge team.