MzeroMiko / VMamba

VMamba: Visual State Space Models,code is based on mamba
MIT License
2.06k stars 123 forks source link

segmentation erf #246

Closed DuHao55 closed 2 months ago

DuHao55 commented 3 months ago

May I know how to use erf.py to draw erf about segmentation task? I noticed that my dataset format(like VOC format) is not quite the same as the dataset format for the classification task.

MzeroMiko commented 3 months ago

You can just load the pictures from your dataset to replace dataset = datasets.ImageFolder(os.path.join(data_path, 'val'), transform=transform) in class EffectiveReceiptiveField in utils.py. I think the conclusion would not be that different from classification.

But if you really want to derive into the task segmentation from the perspective of ERF, I recommend you to use the checkpoint tuned in segmentation and see if it differs from the same model trained on classification.

DuHao55 commented 3 months ago

Thanks,I still don't understand what you mean. I am using it for segmentation task and the dataset format is as follows: ├── dataset │ ├──images │ │ ├── train │ │ └── val │ ├── labels │ │ ├── train │ │ └── val How can I change the EffectiveReceiptiveField in utils.py?

MzeroMiko commented 3 months ago

So how you get the dataset instance for segmentation?

After you get that, you can replace the line

https://github.com/MzeroMiko/VMamba/blob/0a74a29eefb9223efc1a399000e22a723390defd/analyze/utils.py#L328

with your own built dataset. and that is all you need to do if you just want to change the dataset.

DuHao55 commented 3 months ago

Yes, your comment is correct. I noticed that ImageFolder doesn't work for datasets similar to VOC format (ImageFolder needs some subfolders) and I don't know how to load datasets similar to the above format. May I ask how I can modify the way line 328 datasets are loaded? ├── dataset │ ├──images │ │ ├── train │ │ └── val │ ├── labels │ │ ├── train │ │ └── val