peal.web.cache¶
Per-image cache of a web-demo job, built in ONE pass over the upload:
python -m peal.web.cache <job_dir>
The uploaded classifier is the slow part of a job (an onnx2torch-converted
ViT runs at ~90 img/s on an RTX 3090), and before this cache the accuracy
check, step 1 of DiDAE, the DFR correction and the per-direction analysis
(twice) each pushed every image through it again. Now the accuracy check
builds <job>/cache/images.npz and the others read from it:
keysimage key (
dataset.keys) of every image, in the order below;split0 / 1 / 2 for the train / val / test split of
data.yaml;labelsclass index;
logitsthe classifier’s two outputs;
featsits penultimate features (the input of the final linear layer that DFR refits), present only when
find_final_linearfinds that layer; the logits are then computed from them (checked against the full model);clipOpenAI CLIP ViT-L/14 image embedding (the space of the MSAE dictionary), as
peal.web.analysiscomputes it.
Module attributes
CLIP's input normalization (openai/CLIP, ViT-L/14). |
Functions
Compute and write the cache (see the module docstring); returns it. |
|
Path of the cache file of |
|
Weight |
|
The cache of |