Skip to content

Commit 58ed16a

Browse files
committed
Implement evaluation against mimic reports in test set evaluation
1 parent 208ae89 commit 58ed16a

File tree

3 files changed

+246
-636
lines changed

3 files changed

+246
-636
lines changed

src/full_model/custom_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __getitem__(self, index):
3232
# we only need the reference phrases when computing e.g. BLEU during evaluation
3333
bbox_phrases = self.tokenized_dataset[index]["bbox_phrases"] # List[str]
3434

35-
# we need the study_id to retrieve the corresponding mimic_cxr report during evaliation
35+
# we need the study_id to retrieve the corresponding mimic_cxr report during evaluation
3636
study_id = self.tokenized_dataset[index]["study_id"] # str
3737

3838
# cv2.imread by default loads an image with 3 channels

src/full_model/evaluate_full_model/evaluate_model.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def compute_intersection_and_union_area_per_region(detections, targets, class_de
224224
obj_detector_scores["sum_union_area_per_region"] += union_area_per_region_batch
225225

226226

227-
def get_val_losses_and_other_metrics(model, val_dl, log_file, epoch):
227+
def get_val_losses_and_other_metric_scores(model, val_dl, log_file, epoch):
228228
"""
229229
Args:
230230
model (nn.Module): The input model to be evaluated.
@@ -474,7 +474,7 @@ def evaluate_model(model, train_losses_dict, val_dl, lr_scheduler, optimizer, sc
474474
obj_detector_scores,
475475
region_selection_scores,
476476
region_abnormal_scores,
477-
) = get_val_losses_and_other_metrics(model, val_dl, log_file, epoch)
477+
) = get_val_losses_and_other_metric_scores(model, val_dl, log_file, epoch)
478478

479479
# TODO: delete 2nd and 3rd condition (since they are only there to save time)
480480
if not PRETRAIN_WITHOUT_LM_MODEL and overall_steps_taken > 25000 and bool_evaluate_language_model:

0 commit comments

Comments
 (0)