- Extend shared types for image classification, including PredictionProbability, UploaderMetadata, and ImageClassificationRecord. - Create image_classifications table in the database with necessary fields and foreign key constraints. - Implement disease mappers to convert database rows to shared disease records. - Develop uploader client to handle image uploads to external service. - Create image model service to load and classify images using TensorFlow.js. - Add API routes for image classification, including GET for history and POST for new classifications. - Implement frontend components for image classification form and display results. - Update dashboard to integrate image classification functionality and display results. - Document implementation plan for backend image classification.
18 lines
604 B
TypeScript
18 lines
604 B
TypeScript
import type { DiseaseCatalogItem, DiseaseSlug, DiseaseLabel, RiskLevel } from '@zeavis/shared';
|
|
import type { diseaseCatalog } from '../db/schema';
|
|
|
|
export function toDisease(row: typeof diseaseCatalog.$inferSelect): DiseaseCatalogItem {
|
|
return {
|
|
slug: row.slug as DiseaseSlug,
|
|
label: row.label as DiseaseLabel,
|
|
commonName: row.commonName,
|
|
summary: row.summary,
|
|
description: row.description,
|
|
symptoms: row.symptoms,
|
|
recommendations: row.recommendations,
|
|
riskLevel: row.riskLevel as RiskLevel,
|
|
accentColor: row.accentColor,
|
|
displayOrder: row.displayOrder,
|
|
};
|
|
}
|