Git Product home page Git Product logo

Comments (4)

michelbotros avatar michelbotros commented on June 14, 2024 1

Hi Mart,

Great, there is options already! I'll try those. I think I should manage with the information provided. Good to hear that you're working on documentation. I'll let you know if I have any further issues or questions.

Thanks,

Michel

from pathology-whole-slide-data.

martvanrijthoven avatar martvanrijthoven commented on June 14, 2024

Dear Michel,

In the batch iterator, you can use any albumentations augmentation. This augmentation callback was implemented by @thijsgelton via batch callbacks. Here is an example config file that includes the configuration and shows how you can use callbacks and in specific the albumentations callback: https://github.com/DIAGNijmegen/pathology-whole-slide-data/blob/main/tests/test_files/user_config.yml

You can also create a Batch or Sample callback and use custom data augmentations. For example, you can subclass SampleCallback and use your own subclass. All patches and labels will be passed through if you add your callback in your config file.

You can use random angle rotation in a custom SampleCallback and crop via the FitOutput sample callback. Please note that this is a sample callback, so the rotation should also be a sample callback and should be specified before the cropping callback. There is no batch cropping callback, but I will implement that soon.

For training HookNet, we used spatial, color, noise, and stain augmentations. Due to low-resolution and high-resolution patches, you will have to be careful in applying distortive augmentations because the effect will be more severe in the low-resolution patch and, therefore can misalign the patches.

I am working on documentation, but this is not done yet, so please let me know if anything is unclear.

Best wishes,
Mart

from pathology-whole-slide-data.

yuling-luo avatar yuling-luo commented on June 14, 2024

Dear Michel,

In the batch iterator, you can use any albumentations augmentation. This augmentation callback was implemented by @thijsgelton via batch callbacks. Here is an example config file that includes the configuration and shows how you can use callbacks and in specific the albumentations callback: https://github.com/DIAGNijmegen/pathology-whole-slide-data/blob/main/tests/test_files/user_config.yml

You can also create a Batch or Sample callback and use custom data augmentations. For example, you can subclass SampleCallback and use your own subclass. All patches and labels will be passed through if you add your callback in your config file.

You can use random angle rotation in a custom SampleCallback and crop via the FitOutput sample callback. Please note that this is a sample callback, so the rotation should also be a sample callback and should be specified before the cropping callback. There is no batch cropping callback, but I will implement that soon.

For training HookNet, we used spatial, color, noise, and stain augmentations. Due to low-resolution and high-resolution patches, you will have to be careful in applying distortive augmentations because the effect will be more severe in the low-resolution patch and, therefore can misalign the patches.

I am working on documentation, but this is not done yet, so please let me know if anything is unclear.

Best wishes, Mart

Hi Mart,
I'm also in the process of applying augmentation technique. The usr_config you shared in this reply can not be found anymore. Would it be possible that you could share a new one? Thanks!

from pathology-whole-slide-data.

martvanrijthoven avatar martvanrijthoven commented on June 14, 2024

Dear @yuling-luo

You can add something like this to your user config:

batch_callbacks:
      - "*object": wholeslidedata.interoperability.albumentations.callbacks.AlbumentationsSegmentationBatchCallback
        augmentations:
          - RandomRotate90:
              p: 0.5
          - Flip:
              p: 0.5
          - RandomSizedCrop:
              p: 1
              min_max_height: [ 100, 200 ]
              height: 284
              width: 284
          - ElasticTransform:
              p: 0.5
              alpha: 45
              sigma: 6
              alpha_affine: 4
          - HueSaturationValue:
              hue_shift_limit: 0.2
              sat_shift_limit: 0.3
              val_shift_limit: 0.2
              p: 0.5
          - GridDistortion:
              p: 1.0
          - RandomBrightnessContrast:
              p: 0.4

Please note that you will need albumentations==1.2.1, newer version of albumentations wont work (will have to update the callback to make it compatible with newer versions.)

Let me know if you have any trouble

from pathology-whole-slide-data.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.