From 9839995f2bd2d3a0060eb14b865599a0750620bb Mon Sep 17 00:00:00 2001 From: Pavel Iakubovskii Date: Wed, 5 Jun 2024 09:29:49 +0000 Subject: [PATCH] Add create model to docs --- docs/quickstart.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 0c27ab4a..c5181f32 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -20,6 +20,19 @@ Segmentation model is just a PyTorch nn.Module, which can be created as easy as: - Check the table with :doc:`available ported encoders and its corresponding weights `. - `Pytorch Image Models (timm) `_ encoders are also supported, check it :doc:`here`. +Alternatively, you can use `smp.create_model` function to create a model by name: + +.. code-block:: python + + model = smp.create_model( + arch="fpn", # name of the architecture, e.g. 'Unet'/ 'FPN' / etc. Case INsensitive! + encoder_name="mit_b0", + encoder_weights="imagenet", + in_channels=1, + classes=3, + ) + + **2. Configure data preprocessing** All encoders have pretrained weights. Preparing your data the same way as during weights pre-training may give your better results (higher metric score and faster convergence). But it is relevant only for 1-2-3-channels images and **not necessary** in case you train the whole model, not only decoder.