Doodleverse / segmentation_zoo

A collection of geoscientific image segmentation models
MIT License
7 stars 3 forks source link

Model Architecture of NDWI 4 class segformer #37

Open wrosenbluth opened 6 months ago

wrosenbluth commented 6 months ago

Hi All! I'm interested in using your NDWI 4 class segformer to do some shoreline detection, but I'm noticing that the h5 file 'sat4class_ndwi_512_v2_segformer_fullmodel.h5' contains only the model weights, not the full model. I see on the wiki that you're using the mit-b0 version of segformer. I am wondering, did you code the layers yourself, or download a model architecture from somewhere? I am currently trying to initialize a b0 segformer with your weights so that I can fine tune it on a custom dataset. If you could direct me to where you got the model or how you built it that would be greatly appreciated! Thanks!

ebgoldstein commented 5 months ago

Hi @wrosenbluth ! :wave:

The weights for the model were derived from finetuning this huggingface pretrained b0 segformer with our training tool Segmentation Gym ...

the details on our model implementation are similar to the keras example, and leverage the huggingface TF segformer implementation

here are the relevant lines for when we call the model + pretrained checkpoint from HF.

Does this answer your questions?

i have not used that 'sat4class_ndwi_512_v2_segformer_fullmodel.h5 model, which i assume is from a zenodo release made by @dbuscombe-usgs .

@dbuscombe-usgs , anything to add?

wrosenbluth commented 5 months ago

Ah great, good to see. I have been using this exact segformer from hugging face and loading your weights onto it! I wanted to make sure I wasn't doing something crazy by doing so. Thanks for the response.