Backend inference interface: accept a CAM output from the swin classifier
- Linguagem predominante
- Python
- Estrelas
- 2
- Forks
- 2
- Merge médio
- 5d 6h
- PRs com merge (30d)
- 5
Descrição
The FastAPI EigenGradCAM service (ai-cfia/nachet-model-ccds#38) returns a second
Triton output, `CAM` (FP32, shape `[images, k, grid, grid]`), alongside the usual
`PREDICTIONS`.
The backend can't consume this today. `TritonInferenceResponse` validates that a
swin response has exactly one output named `PREDICTIONS`:
- `backend/app/model/inference.py:609` — `raise ValueError("27spp model returns exactly one output (PREDICTIONS)")`
- `backend/app/model/inference.py:582` — output name must be `"PREDICTIONS"`
To surface explainability through the platform, the backend response contract needs
to optionally accept and pass through a `CAM` output when the model emits one, without
breaking models that return predictions only.
Scope:
- [ ] Relax/extend the swin response model to allow an optional `CAM` output
- [ ] Thread the CAM data through to the API response the frontend consumes
- [ ] Note: `CAM.data` is a nested FP32 array, not a JSON string (unlike PREDICTIONS)
Blocks the "Update Nachet Backend" step of ai-cfia/nachet#34.
Ref: ai-cfia/nachet-model-ccds#38.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Start in backend/app/model/inference.py at the output-name check around line 582 and the single-output validation around line 609. Follow the swin response through the backend API contract to the frontend consumer, then verify that optional nested FP32 CAM data is passed through while predictions-only responses still validate and serialize correctly.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- fastapi, python
- Domínio
- api, backend
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Pouca atividade
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 55/100