BAAI-DCAI / SegVol

The official code for "SegVol: Universal and Interactive Volumetric Medical Image Segmentation".
MIT License
248 stars 22 forks source link

no text prompt #10

Closed Jasonhyw closed 10 months ago

Jasonhyw commented 10 months ago

Thank you for sharing. I want to training the model without text prompt, and my dataset don't have the text prompt. How shuold I modify the training code?

Yuxin-Du-Lab commented 10 months ago

I think you can make changes from three aspects: dataset, training loop, and model pipeline.

  1. Preprocess your data labels into the SegVol's pseudo label format because pseudo labels also lack text. Then modify the dataset class to load your data correctly. These modifications are mainly in data_utils.py.
  2. Based on the dataset modifications you made, adjust the relevant parts of the dataloader in train.py. Remove the for loop: 'for cls_idx in range(len(organ_name_list))' because it serves text categories.
  3. Adjust network/model.py by replacing the supervised_forward strategy with the unsupervised_forward strategy. The unsupervised_forward strategy is designed for training with labels lacking text.

There are quite a lot of parts involved in the actual modifications, so please adjust the code according to the situation. Wish you smooth progress.😋