Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
feedback from Max
Browse files Browse the repository at this point in the history
  • Loading branch information
vale-salvatelli committed Dec 14, 2021
1 parent a8a2cb4 commit ec4f582
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions InnerEye/ML/Histopathology/models/deepmil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# ------------------------------------------------------------------------------------------

import logging
from pathlib import Path
import pandas as pd
import numpy as np
Expand Down Expand Up @@ -201,10 +202,14 @@ def _shared_step(self, batch: Dict, batch_idx: int, stage: str) -> Dict[ResultsK
ResultsKey.PROB: probs, ResultsKey.PRED_LABEL: preds,
ResultsKey.TRUE_LABEL: bag_labels, ResultsKey.BAG_ATTN: bag_attn_list,
ResultsKey.IMAGE: batch[TilesDataset.IMAGE_COLUMN]})

if (TilesDataset.TILE_X_COLUMN in batch.keys()) and (TilesDataset.TILE_Y_COLUMN in batch.keys()):
results.update({ResultsKey.TILE_X: batch[TilesDataset.TILE_X_COLUMN],
ResultsKey.TILE_Y: batch[TilesDataset.TILE_Y_COLUMN]}
)
else:
logging.warning("Coordinates not found in batch. If this is not expected check your input tiles dataset.")

return results

def training_step(self, batch: Dict, batch_idx: int) -> Tensor: # type: ignore
Expand Down

0 comments on commit ec4f582

Please sign in to comment.