Skip to content

Commit

Permalink
fix: fix min_confidence parameter in /logos/search route
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Oct 27, 2022
1 parent 450d53f commit b00ad84
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions robotoff/app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,19 +683,16 @@ def on_get(self, req: falcon.Request, resp: falcon.Response):
if annotated is not None:
where_clauses.append(LogoAnnotation.annotation_value.is_null(not annotated))

if min_confidence is not None:
where_clauses.append(LogoAnnotation.score >= min_confidence)

join_image_prediction = False
join_image_model = False

if server_domain:
where_clauses.append(ImageModel.server_domain == server_domain)
join_image_model = True

if min_confidence is not None:
# TODO(raphael): We should filter based on individual logo object confidence
# and not on image object with the maximum confidence
where_clauses.append(ImagePrediction.max_confidence >= min_confidence)
join_image_prediction = True

if barcode is not None:
where_clauses.append(ImageModel.barcode == barcode)
join_image_model = True
Expand Down

0 comments on commit b00ad84

Please sign in to comment.