feat(malaria): implement robust malaria image classification model#9
feat(malaria): implement robust malaria image classification model#9
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe pull request refactors the blood smear analysis architecture from a monolithic detection approach to a modular, registry-based pipeline. It introduces a centralized analysis function, creates dedicated detection and classification modules (MalariaClassifier, CellDetectionModel), establishes a model registry for centralized management, and updates the Streamlit UI to consume the unified API. Legacy code is removed and utilities are adapted to the new structure. Changes
Sequence DiagramsequenceDiagram
actor User
participant UI as Streamlit UI
participant Pipeline as run_blood_analysis
participant Detector as CellDetectionModel
participant Classifier as Classifier<br/>(WBC/Malaria)
participant Utils as crop_cells
User->>UI: Upload image + Configure settings
UI->>Pipeline: run_blood_analysis(image, conf_threshold, enabled_tasks)
activate Pipeline
Pipeline->>Detector: Set confidence threshold
Pipeline->>Detector: predict(image)
Detector-->>Pipeline: {detections: [...]}
Note over Pipeline: Iterate enabled classifiers
Pipeline->>Pipeline: Check if classifier enabled
alt Classifier enabled & detections match input_class
Pipeline->>Utils: crop_cells(image, results, class_name, padding, output_size)
Utils-->>Pipeline: [cropped_cells]
loop For each cropped cell
Pipeline->>Classifier: predict(cell_image)
Classifier-->>Pipeline: {class, confidence, probabilities}
end
Pipeline->>Pipeline: Aggregate into results[classifier_key]
end
Pipeline-->>UI: {detection: {...}, classification: {...}}
deactivate Pipeline
UI->>UI: Render results & visualizations
UI-->>User: Display analysis
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~45–60 minutes
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Refactor