Usage Guide¶
This document explains how to use the different parts of the Cervical Cytology AI system.
1. Running the FastAPI Application¶
The primary way to use the pipeline is via its FastAPI backend.
The API will be available at http://localhost:8000.
- Swagger UI: Visit
http://localhost:8000/docsto test the/analyze-slide/endpoint interactively without needing a separate frontend app.
2. End-to-End Pipeline (Standalone)¶
When testing outside an API request, this script simulates a clinical workflow: processing a directory of images as if they were a single slide, performing segmentation, classification, aggregation, and report generation in sequence.
- Input: Place raw frames in
data/Test_APC/(or the folder defined by your config). - Output: Results—both
jsonlogs and a PDF report—are saved todata/reports/.
3. Testing PDF Generation Individually¶
If you only want to test the PDF generator (e.g., verifying aesthetic margins, clinical text formatting, or row coloring) on a directory of existing JSON predictions without running the full neural network, use the provided test script:
Custom Input/Output:
This reads structured SlideReport and ClinicalSummary payloads from JSON files and instantly converts them into aesthetically finished clinical PDFs.
4. Running Inference Only¶
You can run the classifier on individual images or directories without the full segmentation pipeline.
Single Image:
Directory Evaluation:
5. Training the Classifier (MobileViT)¶
Option A: Python Script
Checkpoints will be automatically saved to weights/. Ensure data/SIPAKMED/ is properly formatted before running.
Option B: Jupyter Notebook
You can also explore and train interactively using the provided notebook: