Toolbox for running N2V and friends.
Project description
CAREamics Restoration
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:
- 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")
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file careamics-0.1.0rc4.tar.gz
.
File metadata
- Download URL: careamics-0.1.0rc4.tar.gz
- Upload date:
- Size: 122.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 919a2d6c94cf2273ae4c3a0c99a8314879d88102a45de898d6c5e672db3f8222 |
|
MD5 | b33b01599b1bdd72b69e3797b61c14df |
|
BLAKE2b-256 | 56319d3257a7238d590928f01fc682054d0706b2a2cedeadfa2b068f34755f46 |
Provenance
File details
Details for the file careamics-0.1.0rc4-py3-none-any.whl
.
File metadata
- Download URL: careamics-0.1.0rc4-py3-none-any.whl
- Upload date:
- Size: 134.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee24bc5710bc46a6339a640eb1b03c3a10180610e56936530076931801fe8272 |
|
MD5 | acf2df43ca34c4ca05ba3b8b6661681f |
|
BLAKE2b-256 | 074d4d6a37e517b5af8437a57e9946de232d91fe578ec030e0af7ea5f8ac476b |