MCPcopy Create free account
hub / github.com/DeepLabCut/DeepLabCut / _get_default_conf_to_alpha

Function _get_default_conf_to_alpha

deeplabcut/utils/make_labeled_video.py:1429–1442  ·  view source on GitHub ↗

Creates the default confidence_to_alpha function.

(
    confidence_to_alpha: bool,
    pcutoff: float,
)

Source from the content-addressed store, hash-verified

1427
1428
1429def _get_default_conf_to_alpha(
1430 confidence_to_alpha: bool,
1431 pcutoff: float,
1432) -> Callable[[float], float] | None:
1433 """Creates the default confidence_to_alpha function."""
1434 if not confidence_to_alpha:
1435 return None
1436
1437 def default_confidence_to_alpha(x):
1438 if pcutoff == 0:
1439 return x
1440 return np.clip((x - pcutoff) / (1 - pcutoff), 0, 1)
1441
1442 return default_confidence_to_alpha
1443
1444
1445if __name__ == "__main__":

Callers 2

create_labeled_videoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected