Closed AjeyPaiK closed 1 year ago
Changes:
Lightning has changed the way it handles prediction outputs. Attached the screenshot below. Earlier, the model outputs were automatically consumed by on_predict_epoch_end()
but this behavior has changed. Now, we access them through the trainer object as shown below on the right.
So, we make this change in lit_module,
For my purposes, I need to maintain additional functionalities like a tracker that can measure tumor-stroma ratio during inference which doesn't align with general ahcore functionalities. So, I added such files to gitignore. This will allow me to have them in my local repo whereas the public code neednt have it. This is reflected here.
One main change that this PR makes is it adds a flag to the way we compute dice scores over the WSIs. Instead of averaging individual dice scores over the total images, we now aggregate true_positives and cardinalities across the whole validation dataset and treat them as though they originate from a single image. Thus avoiding the need to average while providing more stable DIce estimates. This is reflected here.
Finally, I have refactored the trackers.py a little bit. I moved the tile iterator out of the Tracker class since it was not dependent on the class variables to function.
The PR makes changes: