diff --git a/src/stratigraphy/util/interval.py b/src/stratigraphy/util/interval.py index e137aeda..b141e440 100644 --- a/src/stratigraphy/util/interval.py +++ b/src/stratigraphy/util/interval.py @@ -59,10 +59,6 @@ class AnnotatedInterval: end: float background_rect: fitz.Rect - @property - def line_anchor(self) -> fitz.Point: - return fitz.Point(0, 0) - class BoundaryInterval(Interval): """Class for boundary intervals. diff --git a/src/stratigraphy/util/predictions.py b/src/stratigraphy/util/predictions.py index 84f326c5..33385a5b 100644 --- a/src/stratigraphy/util/predictions.py +++ b/src/stratigraphy/util/predictions.py @@ -111,9 +111,15 @@ def create_from_json(predictions_for_file: dict, file_name: str): def create_from_label_studio(annotation_results: dict): """Create predictions class for a file given the annotation results from Label Studio. + This method is meant to import annotations from label studio. The primary use case is to + use the annotated data for evaluation. For that purpose, there is the convert_to_ground_truth + method, which then converts the predictions to ground truth format. + NOTE: We may want to adjust this method to return a single instance of the class, instead of a list of class objects. + NOTE: Before using this to create new ground truth, this method should be tested. + Args: annotation_results (dict): The annotation results from Label Studio. The annotation_results can cover multiple files. @@ -212,6 +218,11 @@ def create_from_label_studio(annotation_results: dict): def convert_to_ground_truth(self): """Convert the predictions to ground truth format. + This method is meant to be used in combination with the create_from_label_studio method. + It converts the predictions to ground truth format, which can then be used for evaluation. + + NOTE: This method should be tested before using it to create new ground truth. + Returns: dict: The predictions in ground truth format. """