Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions ckn_dashboard/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM --platform=linux/amd64 python:3.9-slim
FROM python:3.9-slim

WORKDIR /app

COPY Home.py /app/
COPY ckn_kg.py /app/
COPY llm_graph.py /app/
COPY util.py /app/
COPY modelcards /app/modelcards
COPY requirements.txt /app/
COPY /pages /app/pages
COPY ckn_dashboard/Home.py /app/
COPY ckn_dashboard/ckn_kg.py /app/
COPY ckn_dashboard/llm_graph.py /app/
COPY ckn_dashboard/util.py /app/
COPY ckn_dashboard/modelcards /app/modelcards
COPY ckn_dashboard/requirements.txt /app/
COPY ckn_dashboard/pages /app/pages

RUN pip install -r /app/requirements.txt

Expand Down
42 changes: 42 additions & 0 deletions ckn_dashboard/ckn_kg.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,48 @@ def convert_to_datetime(self, neo4j_datetime):
int(neo4j_datetime.nanosecond / 1000),
tzinfo=neo4j_datetime.tzinfo)

def get_experiment_metrics(self, experiment_id):
"""
Get experiment metrics directly from the Experiment node.
Returns the stored metrics like f1_score, precision, recall, etc.
"""
query = """
MATCH (e:Experiment {experiment_id: '""" + experiment_id + """'})
RETURN e.f1_score as f1_score,
e.precision as precision,
e.recall as recall,
e.false_positives as false_positives,
e.false_negatives as false_negatives,
e.true_positives as true_positives,
e.total_ground_truth_objects as total_ground_truth_objects,
e.total_predictions as total_predictions,
e.total_images as total_images,
e.mean_iou as mean_iou,
e.map_50 as map_50,
e.map_50_95 as map_50_95
"""

result = self.session.run(query)
record = result.single()

if record:
return {
"f1_score": record["f1_score"],
"precision": record["precision"],
"recall": record["recall"],
"false_positives": record["false_positives"],
"false_negatives": record["false_negatives"],
"true_positives": record["true_positives"],
"total_ground_truth_objects": record["total_ground_truth_objects"],
"total_predictions": record["total_predictions"],
"total_images": record["total_images"],
"mean_iou": record["mean_iou"],
"map_50": record["map_50"],
"map_50_95": record["map_50_95"]
}
else:
return None

def convert_to_native(self, dt):
"""Convert Neo4j DateTime to Python native datetime"""
if isinstance(dt, neo4j.time.DateTime):
Expand Down
Loading