kreshuklab / plant-seg

A tool for cell instance aware segmentation in densely packed 3D volumetric images
https://kreshuklab.github.io/plant-seg/
MIT License
88 stars 31 forks source link

Fix halo implementation and tiling artefact #220

Closed qin-yu closed 4 months ago

qin-yu commented 4 months ago

Fix halo implementation and tiling artefact

  1. Fix halo implementation from mirror padding to actual groundtruth
  2. Fix normalisation from patch-level intensity normalisation to image-level
  3. I recommend batch norm for training models for wide applicability

See my fix to pytorch-3dunet https://github.com/wolny/pytorch-3dunet/pull/113 for more details.

image

qin-yu commented 4 months ago

I just fixed the problem in workflow:

But it seems that I need to add and modify tests

lorenzocerrone commented 4 months ago

Hey @Qin very nice, I like the pydantic validation a lot.. should we also add it to the plantseg configs? I think it would be so much nicer than the buggy validation I made.

!!!wrong pr!!! This comment was for the ModelZoo PR

qin-yu commented 4 months ago

Hey @lorenzocerrone, I

Please have a look

qin-yu commented 4 months ago

I improved the docstring based on Adrian's feedback: https://github.com/wolny/pytorch-3dunet/pull/113#discussion_r1562584570

Since I'm already improving the docstrings, I also fixed the arg types and made some simple improvement of code.

I'll merge this and work on the next.

qin-yu commented 4 months ago

Removing the unused argument in get_test_augmentations() introduced a bug. Then I found that I might also have overlooked the previous global normalisation. Going to check it later.