Skip to content

Export to BMZ#

The BioImage Model Zoo is a zoo of models that can be run in a variety of software thanks to the BMZ format. CAREamics is compatible with the BMZ format and can export and load (CAREamics) models in this format.

To export a trained model, you can simply call careamist.export_to_bmz:

Export to BMZ format
careamist.export_to_bmz(
    path_to_archive=export_path / "my_model.zip",  # (1)!
    friendly_model_name="CARE_mito",  # (2)!
    input_array=my_array,  # (3)!
    authors=[
        {
            "name": "Ignatius J. Reilly",
            "affiliation": "Levy Pants",
            "email": "ijr@levy.com",
        },
        {"name": "Myrna Minkoff", "orcid": "0000-0002-3291-8524"},  # (4)!
    ],
    general_description="This model was trained to denoise 2D images of mitochondria.",  # (5)!
)
  1. The model export should be a .zip file, if not CAREamics will add the extension.

  2. Give the model a name that is informative! It should consist of letters, numbers, hyphens and underscores.

  3. We need an input array to verify the export, the input and the prediction will be packaged in the BMZ model. They will also be used to create the cover of the model if it is uploaded to the BioImage Model Zoo.

  4. You can have multiple authors, and affiliation, email, orcid and github _user.

  5. A README will automatically be generated by CAREamics, containing information on how the model was trained. The general description should be a short description of what the model is used for.

Optional parameters#

The export_to_bmz function has a number of optional parameters:

careamist.export_to_bmz(
    path_to_archive=export_path / "my_model.zip",
    friendly_model_name="CARE_mito",
    input_array=my_array,
    authors=[
        {
            "name": "Ignatius J. Reilly",
            "affiliation": "Levy Pants",
            "email": "ijr@levy.com",
        },
        {"name": "Myrna Minkoff", "orcid": "0000-0002-3291-8524"},
    ],
    general_description="This model was trained to denoise 2D images of mitochondria.",
    channel_names=["mito", "nucleus"],  # (1)!
    data_description="The data was acquired on a confocal microscope [...]",  # (2)!
)
  1. If your data has channels, then you should add their name!

  2. The data description can be added to the README as well.

Examples of CAREamics models#

In progress

This page is still in construction.