peal.web.app

HTTP API of the PEAL web demo (FastAPI).

uvicorn peal.web.app:app –host 0.0.0.0 –port 8080

Flow: POST /api/uploads/model (ONNX) -> interface + upload token

POST /api/uploads/dataset (zip) -> class folders + upload token POST /api/jobs -> job id (validates the mandatory fields) GET /api/jobs/{id} -> status, queue position, wait estimate GET /api/jobs/{id}/feedback -> collages waiting for a verdict POST /api/jobs/{id}/feedback -> the verdicts GET /api/jobs/{id}/results -> results.json GET /api/jobs/{id}/files/{path} -> collages, corrected model POST /api/jobs/{id}/cancel

Environment:

PEAL_WEB_JOBS jobs root (default $PEAL_RUNS/web_jobs or ./web_jobs) PEAL_RAE_WEIGHTS hf://<org>/<repo> or a local weights folder (required to run) PEAL_WEB_NO_WORKER=1 do not start the worker thread (tests, separate worker host) PEAL_WEB_MAX_ZIP_MB / PEAL_WEB_MAX_FILES / PEAL_WEB_MAX_ONNX_MB upload limits

Module attributes

MAX_RENDER_DIRECTIONS

each direction renders every one of its latent flips (up to the whole sample pool).

PAIR_COLLAGE_RE

rank<r>_dir<d>_pair<p>_conf<c>.png for the pair, and a folder rank<r>_dir<d>_<concept name> next to it holding the detailed collage <p:07d>_collage.png (factual, counterfactual, SSIM difference); see DiDAE._generate_direction_collages.

Functions

create_app

Build the FastAPI application of the web demo.

group_by_direction

Group feedback items by the direction their collage belongs to.

pretty_direction_name

OFF_downing_SAE_3303_TO_ON_dogs_SAE_853 -> OFF downing #3303 → ON dogs #853.