f1_detection¶

f1_detection(true, pred, radius)[source]¶

Calculate the F1-score for predicted set of coordinates.

Examples

>>> from tiatoolbox.utils.metrics import f1_detection
>>> # Generate two random example sets; replace with your own data
>>> import numpy as np
>>> np.random.seed(6)
>>> true_num_points = np.random.randint(low=10, high=30)
>>> pred_num_points = np.random.randint(low=10, high=30)
>>> true = np.random.randint(low=0, high=25, size=(true_num_points, 2))
>>> pred = np.random.randint(low=0, high=25, size=(pred_num_points, 2))
>>> radius = 2.0
>>> # Example usage of f1_detection
>>> f1_score = f1_detection(true, pred, radius)
Parameters:
Return type:

float