From 7d117a3ecce67658f8f09b8dd944669c4f5c6356 Mon Sep 17 00:00:00 2001 From: Murdaugh <144931866+AlexMurd@users.noreply.github.com> Date: Tue, 16 Jan 2024 00:51:04 +0200 Subject: [PATCH] Update vision.py --- ghunt/parsers/vision.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ghunt/parsers/vision.py b/ghunt/parsers/vision.py index 24c916cd..2089bc44 100644 --- a/ghunt/parsers/vision.py +++ b/ghunt/parsers/vision.py @@ -88,7 +88,10 @@ def __init__(self): self.face_annotations: List[VisionFaceAnnotation] = [] def _scrape(self, vision_data: Dict[str, any]): - for face_data in vision_data["faceAnnotations"]: - face_annotation = VisionFaceAnnotation() - face_annotation._scrape(face_data) - self.face_annotations.append(face_annotation) \ No newline at end of file + if 'faceAnnotations' in vision_data: + for face_data in vision_data["faceAnnotations"]: + face_annotation = VisionFaceAnnotation() + face_annotation._scrape(face_data) + self.face_annotations.append(face_annotation) + else: + print("No face annotations found in the vision data.")