When starting food detection with PassioSDK.startFoodDetection you will receive a FoodDetectionEvent. This is the structure of that data class:
export interface FoodDetectionEvent {
/**
* A collection of food candidates detected by the models.
*/
candidates?: FoodCandidates;
/**
* Detected nutrition facts when scanning a nutrition label.
*/
nutritionFacts?: NutritionFacts;
}
/**
* A collection of food candidates detected by the models.
*/
export interface FoodCandidates {
/**
* Food candidate results from visual scanning. The array is sorted by confidence, with the most confident result at index 0.
*/
detectedCandidates: DetectedCandidate[]
/**
* Food candidate results from barcode scanning.
*/
barcodeCandidates?: BarcodeCandidate[]
/**
* Food candidate results from packagedFoodCode scanning.
*/
packagedFoodCode?: PackagedFoodCode[]
}
/**
* Nutrition facts scanned from the nutrition label on a package food item
*/
export interface NutritionFacts {
servingSizeQuantity?: number
servingSizeUnitName?: string
servingSizeGram?: number
servingSizeUnit: ServingSizeUnit
calories?: number
fat?: number
carbs?: number
protein?: number
saturatedFat?: number
transFat?: number
cholesterol?: number
sodium?: number
dietaryFiber?: number
sugars?: number
sugarAlcohol?: number
}
If at any point you need help from the Passio team, please reach out to us at support@passiolife.com