Skip to content

Commit

Permalink
Update visionUtils.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
BurhanCantCode authored Aug 2, 2024
1 parent cb29f69 commit c6ec39b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/visionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const scanProduct = async (imageData: string): Promise<{ name: string; qu

// Filter out generic labels
const specificLabels = labels.filter(label =>
!['Food', 'Produce', 'Natural foods', 'Fruit', 'Vegetable'].includes(label.description)
label.description && !['Food', 'Produce', 'Natural foods', 'Fruit', 'Vegetable'].includes(label.description)
);

if (specificLabels.length > 0) {
Expand All @@ -45,4 +45,4 @@ export const scanProduct = async (imageData: string): Promise<{ name: string; qu
console.error('Error in scanProduct:', error);
throw new Error(`Failed to scan product: ${error.message}`);
}
};
};

0 comments on commit c6ec39b

Please sign in to comment.