Skip to content

Commit

Permalink
Extend docstring for FilePrediction class methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
redur committed May 2, 2024
1 parent 44720d1 commit 84fc40f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/stratigraphy/util/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions src/stratigraphy/util/predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
"""
Expand Down

0 comments on commit 84fc40f

Please sign in to comment.