Skip to content

Commit

Permalink
Revert "Internal function bugfix (#296)"
Browse files Browse the repository at this point in the history
This reverts commit 9d153a4.
  • Loading branch information
brandon-groundlight authored Dec 12, 2024
1 parent 9d153a4 commit 3501a7f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ packages = [
{include = "**/*.py", from = "src"},
]
readme = "README.md"
version = "0.21.1"
version = "0.21.0"

[tool.poetry.dependencies]
# For certifi, use ">=" instead of "^" since it upgrades its "major version" every year, not really following semver
Expand Down
4 changes: 0 additions & 4 deletions src/groundlight/internalapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,13 @@ def iq_is_confident(iq: ImageQuery, confidence_threshold: float) -> bool:
The only subtlety here is that currently confidence of None means
human label, which is treated as confident.
"""
if not iq.result:
return False
return iq.result.confidence >= confidence_threshold # type: ignore


def iq_is_answered(iq: ImageQuery) -> bool:
"""Returns True if the image query has a ML or human label.
Placeholder and special labels (out of domain) have confidences exactly 0.5
"""
if not iq.result:
return False
if (iq.result.source == Source.STILL_PROCESSING) or (iq.result.source is None): # Should never be None
return False
return True
Expand Down
14 changes: 0 additions & 14 deletions test/unit/test_internalapi.py

This file was deleted.

0 comments on commit 3501a7f

Please sign in to comment.