Skip to content

Commit

Permalink
Merge pull request #57 from swisstopo/visualisation_without_ground_truth
Browse files Browse the repository at this point in the history
Enable visualisation without ground truth for that file
  • Loading branch information
stijnvermeeren-swisstopo authored Jun 4, 2024
2 parents 6dedc85 + 6381102 commit a363e1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/stratigraphy/benchmark/ground_truth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def __init__(self, path: Path):
metadata = ground_truth_item["metadata"]
self.ground_truth[borehole_profile]["metadata"] = metadata

def for_file(self, file_name: str) -> list:
def for_file(self, file_name: str) -> dict:
if file_name in self.ground_truth:
return self.ground_truth[file_name]
else:
logger.warning(f"No ground truth data found for {file_name}.")
return []
return {}
6 changes: 4 additions & 2 deletions src/stratigraphy/benchmark/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ def create_predictions_objects(predictions: dict, ground_truth_path: Path) -> tu

predictions_objects[file_name] = prediction_object
if ground_truth_is_present:
predictions_objects[file_name].evaluate(ground_truth.for_file(file_name))
number_of_truth_values[file_name] = len(ground_truth.for_file(file_name)["layers"])
ground_truth_for_file = ground_truth.for_file(file_name)
if ground_truth_for_file:
predictions_objects[file_name].evaluate(ground_truth_for_file)
number_of_truth_values[file_name] = len(ground_truth_for_file["layers"])

return predictions_objects, number_of_truth_values

Expand Down

1 comment on commit a363e1a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/stratigraphy
   __init__.py8188%11
   extract.py2102100%3–506
   get_files.py21210%3–48
   line_detection.py26260%3–76
   main.py91910%3–234
src/stratigraphy/util
   coordinate_extraction.py1172083%27, 47, 51, 55, 59–67, 88, 164, 184, 273, 276–277, 281, 293
   dataclasses.py32391%37–39
   depthcolumn.py2086768%26, 30, 51, 57, 60–61, 85, 88, 95, 102, 110–111, 121, 138–154, 199, 238, 254–262, 274, 279, 286, 313, 323, 352, 373, 376–387, 402–403, 448–490
   depthcolumnentry.py20480%12, 15, 27, 34
   description_block_splitter.py70297%24, 139
   draw.py73730%3–225
   duplicate_detection.py51510%3–146
   find_depth_columns.py89693%41–42, 70, 82, 175–176
   find_description.py632856%27–35, 50–63, 79–95, 172–175
   geometric_line_utilities.py86298%82, 132
   interval.py1075251%25–28, 32–35, 40, 45, 48, 100–146, 167, 172–188
   language_detection.py18180%3–45
   layer_identifier_column.py91910%3–227
   line.py492647%25, 42, 51, 65–95, 98
   linesquadtree.py46198%76
   plot_utils.py43430%3–120
   predictions.py1861860%3–386
   textblock.py74889%27, 51, 63, 75, 98, 119, 127, 155
   util.py402245%15–18, 22, 26, 40–47, 61–63, 87–88, 100–105
TOTAL1819105242% 

Tests Skipped Failures Errors Time
58 0 💤 0 ❌ 0 🔥 0.625s ⏱️

Please sign in to comment.