Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about use EM datasets #18

Open
ohcccc opened this issue Mar 27, 2024 · 6 comments
Open

about use EM datasets #18

ohcccc opened this issue Mar 27, 2024 · 6 comments

Comments

@ohcccc
Copy link

ohcccc commented Mar 27, 2024

HI,thanks for sharing your impressive code.
I've been working on EM images segmentation using sparse instance label lately. I want to follow your work. Could you share codes about MitoEM-R with me?
@wolny

@wolny
Copy link
Contributor

wolny commented Apr 7, 2024

Hi @ohcccc, thanks for your interest. Training/prediction process for large 3D stacks such as MitoEM is happening patch-by-patch. To keep things simple I didn't include it in this repo and included instructions for Cityscapes and CVPPP datasets only.
That being said, I do have the code for MitoEM ready. I'll clean it up a bit and push it to this repo in the coming days.

@ohcccc
Copy link
Author

ohcccc commented Apr 8, 2024

thank you very much for your reply,Looking forward to your code.

@ohcccc
Copy link
Author

ohcccc commented Jun 10, 2024

@wolny
Hi
I hope you're doing well. I wanted to follow up on our previous conversation regarding the MitoEM code. You mentioned on April 8th that you would clean up and push the code to the repository in the coming days. I understand that you might be busy, but I was wondering if there has been any progress on this.

I’m really excited to use your code for my research on EM images segmentation using sparse instance labels, and your contribution would be incredibly valuable to my work.

Thank you again for your help and looking forward to hearing from you.

@wolny
Copy link
Contributor

wolny commented Jun 23, 2024

hi @ohcccc, apologies for the delay on this. I've created an initial PR (#19). I'll finish the code and add instructions to the readme this week.

@ohcccc
Copy link
Author

ohcccc commented Jun 26, 2024

Thank you so much!

@ohcccc ohcccc closed this as completed Jun 26, 2024
@ohcccc ohcccc reopened this Jun 29, 2024
@ohcccc
Copy link
Author

ohcccc commented Jun 29, 2024

if self.phase == 'train':
seed = np.random.randint(np.iinfo('int32').max)
random.seed(seed)
torch.manual_seed(seed)
raw_patch_transformed = self.base_raw_transform(self.raw[raw_idx])
random.seed(seed)
torch.manual_seed(seed)
label_idx = self.label_slices[idx]
label_patch_transformed = LABEL_TRANSFORM(self.label[label_idx])[0]
if self.spoco:
raw_patch_transformed1 = EXTENDED_TRANSFORM(raw_patch_transformed)
return raw_patch_transformed, raw_patch_transformed1, label_patch_transformed
else:
return raw_patch_transformed, label_patch_transformed

@wolny self.raw[raw_idx] type is numpy.ndarray ? I get an error when I use numpy.ndarray or PIL Image.
‘’‘
File "/media/icml012/HDD/code/spoco/spoco/datasets/volumetric.py", line 121, in getitem
raw_patch_transformed = self.base_raw_transform(self.raw[raw_idx])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/icml012/miniconda3/envs/DL/lib/python3.11/site-packages/torchvision/transforms/transforms.py", line 95, in call
img = t(img)
^^^^^^
File "/home/icml012/miniconda3/envs/DL/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/icml012/miniconda3/envs/DL/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/icml012/miniconda3/envs/DL/lib/python3.11/site-packages/torchvision/transforms/transforms.py", line 720, in forward
return F.hflip(img)
^^^^^^^^^^^^
File "/home/icml012/miniconda3/envs/DL/lib/python3.11/site-packages/torchvision/transforms/functional.py", line 682, in hflip
return F_pil.hflip(img)
^^^^^^^^^^^^^^^^
File "/home/icml012/miniconda3/envs/DL/lib/python3.11/site-packages/torchvision/transforms/_functional_pil.py", line 54, in hflip
raise TypeError(f"img should be PIL Image. Got {type(img)}")
TypeError: img should be PIL Image. Got <class 'numpy.ndarray'>
’‘’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants