qubvel-org / segmentation_models.pytorch

Semantic segmentation models with 500+ pretrained convolutional and transformer-based backbones.
https://smp.readthedocs.io/
MIT License
9.74k stars 1.68k forks source link

How to predict a specified image #931

Closed wangluoWSG closed 1 month ago

wangluoWSG commented 1 month ago

How to use the previously trained model weights to predict a specified image and output the predicted mask.

qubvel commented 1 month ago

Hi @wangluoWSG, thanks for the question!

Here is an example https://github.com/qubvel-org/segmentation_models.pytorch/blob/main/examples/binary_segmentation_intro.ipynb

Please look at the end to see how to make predict and visualise the result

wangluoWSG commented 1 month ago

Thank you very much!