Skip to main content

Toolbox for running N2V and friends.

Project description

CAREamics Restoration

License PyPI Python Version CI codecov

Installation

pip install careamics

For more details on the options please follow the installation guide.

Usage

CAREamics uses the Engine object to construct the pipeline for both training and prediction. First we import the Engine.

from careamics_restoration.engine import Engine

The Engine could be initialized in 2 ways:

  1. Using the yaml config file

Specify the mandatory parameters in the config file

experiment_name: Name of the experiment
working_directory: Path to the working directory, where all the outputs will be stored

algorithm: 
    loss: type of loss function, e.g. n2v for Noise2Void
    model: model architecture, e.g. UNet
    is_3D: True if 3D data, False if 2D data

training:
  num_epochs: Number of training epochs
  patch_size: Size of the patches, List of 2 or 3 elements
  batch_size: Batch size for training

extraction_strategy: Controls how the patches are extracted from the data

data:
    data_format: File extension, e.g. tif
    axes: Defines the shape of the input data

Full description of the configuration parameters is in the documentation.

engine = Engine(config_path="config.yml")
  1. Using the path to the pretrained model It's also possible to initialize the Engine using the model checkpoint, saved during the training or downloaded from the BioImage Model Zoo. Checkpoint must contain model_state_dict. Read more abount saving and loading models in the documentation.

Once Engine is initialized, we can start training, providing the relative paths to train and validation data

engine.train(train_path=train_path, val_path=val_path)

Training will run for the specified number of epochs and save the model checkpoint in the working directory.

Prediction could be done directly after the training or by loading the pretrained model checkpoint.

predictions = engine.predict(pred_path=predict_path)

For more examples please take a look at the notebooks.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

careamics-0.1.0rc3.tar.gz (120.2 kB view details)

Uploaded Source

Built Distribution

careamics-0.1.0rc3-py3-none-any.whl (132.5 kB view details)

Uploaded Python 3

File details

Details for the file careamics-0.1.0rc3.tar.gz.

File metadata

  • Download URL: careamics-0.1.0rc3.tar.gz
  • Upload date:
  • Size: 120.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for careamics-0.1.0rc3.tar.gz
Algorithm Hash digest
SHA256 31a6f4b49de69b3bb12f4084ae279a155bb1bbc73fa1eab782a194e15312e34f
MD5 2f4811c43969153f420801975d421241
BLAKE2b-256 4f448518992eb36cecc99ef089a7050507a9f3dfc25f88c90c62922eda3249a3

See more details on using hashes here.

File details

Details for the file careamics-0.1.0rc3-py3-none-any.whl.

File metadata

  • Download URL: careamics-0.1.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 132.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for careamics-0.1.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 f58fd3766dcebf2538aabb1fbfa94e54b4d77b744de598583c5c722522594841
MD5 7b22d10284a33b7e84f468a489f36862
BLAKE2b-256 96b4faeb769d370e4e22581f73731a963e9a408b8a9523765d55d16df1327a8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page