Open kaczmarj opened 1 year ago
@swaradgat19 - feel free to look into this as well.
@swaradgat19 - i suggest starting small and trying to get tta (test time aug) working on a single patch. we can work on incorporating this into the codebase later on.
the pytorch dataset class we use to read patches is defined here: https://github.com/SBU-BMI/wsinfer/blob/8bdcaa45e6d25e1b6dd394d1cf9328dcc0863b85/wsinfer/modellib/data.py#L52
i don't think that class will work for tta as it is written currently. you can create a new one for your needs. we can work on incorporating it into the codebase later on.
here's how tta would work:
@kaczmarj Should I work on this feature? I am considering writing a separate script for transformations and then calling the function on each patch. What would you suggest?
hi @swaradgat19 - sorry this fell through the cracks of my email! yes, it would be great if you could work on this feature. for debugging and developing, writing a separate script to run transformations makes sense.
test time augmentation has the potential to improve model performance without any changes to the model parameters.
before implementing this, let's consider how best to implement it. i imagine the
run_inference
function can take a boolean argumenttta
ortest_time_augmentation
to enable this feature. if it is enabled, we would run the model on each patch multiple times (once for each transformation). the transformations must be rigid and must not rotate the images in non-90 degree increments.transformations might include: