Skip to content

Commit

Permalink
Added GT to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
dcleres committed Sep 16, 2024
1 parent 750194d commit a443ef6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
source env/bin/activate
pip install -e .
echo "Running pipeline"
boreholes-extract-all -l -i example/example_borehole_profile.pdf -o example/ -p example/predictions.json -m example/metadata.json
boreholes-extract-all -l -i example/example_borehole_profile.pdf -o example/ -p example/predictions.json -m example/metadata.json -g example/example_ground_truth.json
18 changes: 18 additions & 0 deletions example/example_groundtruth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"example_borehole_profile.pdf": {
"groundwater": [],
"layers": [],
"metadata": {
"coordinates": {
"E": 615790,
"N": 157500
},
"drilling_date": "1995-09-03",
"drilling_methods": null,
"original_name": "",
"project_name": "",
"reference_elevation": 788.6,
"total_depth": null
}
}
}
11 changes: 7 additions & 4 deletions src/stratigraphy/benchmark/ground_truth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ class GroundTruth:
def __init__(self, path: Path):
self.ground_truth = defaultdict(dict)

with open(path) as in_file:
# Load the ground truth data
with open(path, encoding="utf-8") as in_file:
ground_truth = json.load(in_file)

# Parse the ground truth data
for borehole_profile, ground_truth_item in ground_truth.items():
layers = ground_truth_item["layers"]
self.ground_truth[borehole_profile]["layers"] = [
Expand All @@ -42,6 +45,6 @@ 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 {}

logger.warning("No ground truth data found for %s.", file_name)
return {}

0 comments on commit a443ef6

Please sign in to comment.