computational-cell-analytics / micro-sam

Segment Anything for Microscopy
https://computational-cell-analytics.github.io/micro-sam/
MIT License
311 stars 35 forks source link

636 enhance 3d image processing based on ma sam #639

Closed lufre1 closed 1 week ago

lufre1 commented 1 week ago

added MA-SAM 3D adapters ideas. Implemented in specific 3D wrappers for the SAM encoder but also for the predictor

lufre1 commented 1 week ago

@constantinpape please have a look

constantinpape commented 1 week ago

This is now working more or less, with a few caveats.

UserWarning: The .grad attribute of a Tensor that is not a leaf Tensor is being acce
ssed. Its .grad attribute won't be populated during autograd.backward(). If you indeed want the .grad field to be populated for a non-leaf Tensor, use .retain_grad() on 
the non-leaf Tensor. If you access the non-leaf Tensor by mistake, make sure you access the leaf Tensor instead. See github.com/pytorch/pytorch/pull/30531 for more infor
mations. (Triggered internally at /opt/conda/conda-bld/pytorch_1695392035891/work/build/aten/src/ATen/core/TensorBody.h:489.)
constantinpape commented 1 week ago

I did some minor refactoring and this should be good to go now. I ll merge it into dev.