Skip to content

Commit

Permalink
Fix MissingCardPage not showing when no card is detected
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashbrnrd committed Jun 17, 2024
1 parent 400ac4f commit 20c19f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1,210 deletions.
5 changes: 5 additions & 0 deletions backend/src/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ async def imageupload(
if label in TYPOLOGIES_MEASURED:
gun_length, gun_barrel_length, conf_card = get_lengths(img_bytes)

# Temporary fix while ML package send 0 instead of None
# https://github.com/dnum-mi/basegun-ml/issues/14
gun_length = None if gun_length == 0 else gun_length
gun_barrel_length = None if gun_barrel_length == 0 else gun_barrel_length

extras_logging["bg_label"] = label
extras_logging["bg_confidence"] = confidence
extras_logging["bg_gun_length"] = gun_length
Expand Down
Loading

0 comments on commit 20c19f1

Please sign in to comment.