Skip to content

Commit

Permalink
Add new probability value to photo view
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Oct 12, 2024
1 parent 8ca663f commit fe7c12c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions api/serializers/photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,19 @@ def get_people(self, obj) -> list:
else ("classification" if f.classification_person else "")
)
),
"probability": (
1
if f.person
else (
f.cluster_probability
if f.cluster_person
else (
f.classification_probability
if f.classification_person
else 0
)
)
),
"face_url": f.image.url,
"face_id": f.id,
}
Expand Down

0 comments on commit fe7c12c

Please sign in to comment.