Home made stardist model#

You can find instructions to train your own stardist model in different places:

The output structure of your model would look like this:

/home/user
    └──model_folder
       ├── PSF_2D_model
          ├── config.json
          ├── thresholds.json
          ├── weights_best.h5
          └── weights_last.h5
       └── PSF_3D_model
           ├── config.json
           ├── thresholds.json
           ├── weights_best.h5
           └── weights_last.h5

To run pyHiM with your models, you need to add model_folder path and the network name inside the parameters.json file:

{
    "common": {
                
    },
    "labels": {
        "barcode": {          
            "segmentedObjects": {

                "stardist_basename": "/home/user/model_folder",
                "stardist_network": "PSF_2D_model",
                "stardist_network3D": "PSF_3D_model"

            }
        }
    }
}

With this example, pyHiM will use your stardist models during the localize_2d and localize_3d routines.

But for the DAPI segmentation (mask_2d and mask_3d), pyHiM will always use the default built-in model.