Releases: BiaPyX/BiaPy
Releases · BiaPyX/BiaPy
Version 3.6.8
Major:
- Move to Pytorch
2.9.1 - Add
TEST.METRICS_IN_CPUoption to calculate test metrics in CPU and make it default. Useful for large datasets such as MitoEM
Minor:
- Update notebooks with version
3.6.7 - Update some aux scripts
- Add
TEST.METRICS_IN_CPUoption to calculate test metrics in CPU and make it default. Useful for large datasets such as MitoEM - Improve error message when an image couldn't be loaded
- Add
TEST.SAVE_MODEL_RAW_OUTPUToption to now save model raw outputs (related to #145) - Add
TEST.POST_PROCESSING.MEASURE_PROPERTIES.EXTRA_PROPSto choose extra properties to be calculated for the predicted instances (related to #144) - Add SpineDL paper scripts and templates
- Simplify
HRNetconfiguration and deletehrnet2x20 - Add
ConvNeXtBlocksto be usable inHRNet - Add different possible heads to
HRNet - Test checkpoint load process and reduce test14 experiment epochs, as it was taking 1h to complete
- Remove
DATA.EXTRACT_RANDOM_PATCH,DATA.REPLICATE, DATA.PROBABILITY_MAP,DATA.W_FOREGROUND,DATA.W_BACKGROUND - Update model references and improve BMZ documentation created
- Change sigmoid to sofmax when classes are more than 2 for semantic seg
- Add option to some models to add activations layers at the end, so no post-processing can be set during BMZ model creation, leading to more stable and reproducible results
- More robust checkpoint capturation during model checkpoint load
Bugs fixed:
- Change conda package action to be done after PyPI's action is done
- Add minor fix to ensure unique_labels_fast functionality when labels are not integers
- Fix edge case when creating the BMZ cover
- Update BMZ model creation to support models that do not output an image with the same shape as the input as
HRNet - Add all the variables used outside
HRNetdefinition inside so it can be exported properly to BMZ - Make all the dependencies found by
extract_modelfunction be in a consistent order so all the dependencies are correctly found, i.e. aux functions/classes first - Resolve
PATHS.CHECKPOINT_FILEvariable bug (related to suggestions to overcome over segmentation) - Do not force class IoU calculation to be uint16 but uint8 in instance segmentation
- Don't change patch size defined in the model yaml if only the channel axis is different
- Solve critical bug in BMZ models, as they were not changed to
.eval()when doing inference - Make metric calculation in denoising more robust
Full Changelog: v3.6.7...v3.6.8
Version 3.6.7
Minor:
- Update all notebooks to the new version and simplify BMZ cell
- Minor change in
fill_holes_in_seg_masks.py - Speed up the label creation process and display ETA bar when there are more than
200instances in the image - Improve error message if something happened extracting the input image shape from model RDF
- Substitute
affable-sharkwith other models as it is currenlty crashing and it is normally the one used to test new things so could not be stable - Enhance
check_masks()error messages - Clarify when
LOSS.CLASS_REBALANCEis used - Make the YAML loading step more robust
- Add
foreground_probs_to_instances.pyaux script
Bugs fixed:
- Try to solve conda-forge-bump issue
- Fix halo values for BMZ packages using 3D models
- Improve
BandFchannels when they are used alone and with weights (We) - Rename
Dcchannel type center tocentroidas other channels and fix a minor bug setting its default value - Fix bug with the inference of BMZ models as the activations were not applied if the model were not defining them explicitly
- Fix errors in
LOSS.CLASS_WEIGHTS - Fix bug using
hrnet48and include it inrun_checks.py
Full Changelog: v3.6.6...v3.6.7
Version 3.6.6
Major:
- Change the augmentations to work with pure 3D images and completely remove
zandcchannel merge process (related to #139) - Update how the instance channels are handled and extend the support to lots of more channels and combinations:
- Renamed old
Dchannel intoDb(distance to boundary) - Renamed old
Bchannel intoF - Add
Tfor the touching areas - Add
Rfor the radial distances, i.e.Stardist - Add
H+V+Zchannels for the distance offset, i.e.Cellpose,Hover-NetandOmnipose. - Now
Dchannel is Db for the foreground and background - Add
Dnfor the distance to neighbors - Add instance refinement post-processing to do filtering and morphological operations before applying any other more complex post-processing (under
TEST.POST_PROCESSING.INSTANCE_REFINEMENT) - Add embeddings as instance representation option (EmbedSeg,
Echannel) - Add U-Net-like border weighting for the instace segmentation workflow (channel
We) - Change the names of the instance segmentationn label directory to create. Now the names are long, as they depend on the channels used and in their options. This ensures creating a new folder if any of the channel options were modified as they may lead to different representations
- Speed up instance representation mask creation with DDP threads already started
- Renamed old
- Speed up generator checks and make the gridmask create the grid with the maximum value per channel
- Update how activations are handled. Now there is one per channel to be more clean
- Resize to the original size if the preprocessing was applied in the test images
- Change test generators to now return also
Yfilename so we can improve the error messages - Add safetensors as a dependency
- Update BiaPy and BioImage Model Zoo's connection:
- Improve BMZ documentation creation based on their Model Card Template
- Ensure an image with some mask information is captures as BMZ test sample
- Generate suitable cover images based directly on the GT (if provided) and not on the model prediction
- Now all the functions used in the notebooks are included in the core
- Simplify some code by merging
check_model_restrictionswithcheck_bmz_model_compatibility. Nowcheck_bmz_model_compatibilitydoes everything - Add halo to the BMZ model (related to #141)
Minor:
- Update conda package CI
- Update docstrings to build the doc (@iarganda)
- Binarized version of semantic segmentation's prediction now are thresholded using otsu instead, and not at
0.5as it used to be - Improve error message when no files are found during instance segmentation target creation data
- Delete
AUGMENTOR.BRIGHTNESS_MODEandAUGMENTOR.CONTRAST_MODE - Delete the old
MODEL.LAST_ACTIVATION - Remove unused
DATA.TRAIN.REPLICATE - Remove
TEST.POST_PROCESSING.FILL_HOLESas it now is insideTEST.POST_PROCESSING.INSTANCE_REFINEMENT - Remove
TEST.POST_PROCESSING.CLEAR_BORDERas it now is insideTEST.POST_PROCESSING.INSTANCE_REFINEMENT - Provide a better message when raw/gt val data does not match
PROBLEM.INSTANCE_SEG.DATA_REMOVE_SMALL_OBJ_BEFOREmoved toPROBLEM.INSTANCE_SEG.WATERSHED.DATA_REMOVE_SMALL_OBJ_BEFOREPROBLEM.INSTANCE_SEG.DATA_REMOVE_BEFORE_MWmoved toPROBLEM.INSTANCE_SEG.WATERSHED.DATA_REMOVE_BEFORE_MWPROBLEM.INSTANCE_SEG.SEED_MORPH_SEQUENCEmoved toPROBLEM.INSTANCE_SEG.WATERSHED.SEED_MORPH_SEQUENCEPROBLEM.INSTANCE_SEG.SEED_MORPH_RADIUSmoved toPROBLEM.INSTANCE_SEG.WATERSHED.SEED_MORPH_RADIUSPROBLEM.INSTANCE_SEG.ERODE_AND_DILATE_GROWTH_MASKmoved toPROBLEM.INSTANCE_SEG.ERODE_AND_DILATE_GROWTH_MASKPROBLEM.INSTANCE_SEG.FORE_EROSION_RADIUSmoved toPROBLEM.INSTANCE_SEG.WATERSHED.FORE_EROSION_RADIUSPROBLEM.INSTANCE_SEG.FORE_DILATION_RADIUSmoved toPROBLEM.INSTANCE_SEG.WATERSHED.FORE_DILATION_RADIUSPROBLEM.INSTANCE_SEG.DATA_CHECK_MWmoved toPROBLEM.INSTANCE_SEG.WATERSHED.DATA_CHECK_MWPROBLEM.INSTANCE_SEG.WATERSHED_BY_2D_SLICESmoved toPROBLEM.INSTANCE_SEG.WATERSHED.BY_2D_SLICES- Remove
PROBLEM.INSTANCE_SEG.SYNAPSES.NORMALIZE_DISTANCESand normalize always for now - Added new auxiliary scripts:
biapy/utils/scripts/measure_dataset_size.pybiapy/utils/scripts/stardist_wheels.pybiapy/utils/scripts/measure_class_weights.pybiapy/utils/scripts/PR_plot_instances.pybiapy/utils/scripts/agreement_manual_points_vs_dnn_instances.pybiapy/utils/scripts/semantic_seg_stats.pybiapy/utils/scripts/collect_instance_sizes.py
Bugs fixed:
- Remove heat norm/unnorm steps
- Disable automatic normalization for instance segmentation channels
- Correct bug in zoom data augmentation with heatmaps (related to #139)
- Remove UNETR unused layer (related to #123)
- Repare SE blocks (related to #123)
- Avoid printing early stopping message more than once in DDP setting
- Solve bug with BMZ model exportation when combined with loading a checkpoint as the loaded model's cfg was overriding the current cfg
- Solve bug in HRNet building process in all version but
hrnet48 - Fix bug with contrastive learning during TTA postprocessing
- Ensure heatmaps are in their original data range after each transformation
- Fix bug in discarding test samples
- Fix problems related to relative paths during BMZ model exportation (related to #140)
- Correct bug in Denoising workflow for multichannel images
- Improve
os_walk_cleanfunction used to sort files/dirs as sometimes the files were not sorted good - Fix issues in BiaPy's CI due to the changes made to adapt the code to Hypha structure API
Full Changelog: v3.6.5...v3.6.6
Version 3.6.5
Minor:
- Allow usage of safetensors to load model weights.
MODEL.OUT_CHECKPOINT_FORMATis created to decide the output checkpoint format
Full Changelog: v3.6.4...v3.6.5
Version 3.6.4
Major:
- Create conda-forge package of BiaPy. Extra info: meta.yaml + CI to trigger package creation on new release
- BMZ updates:
- Creates a
model.pyfile for BMZ packge by collecting all functions and imports that are necessary to build the model - Change the
environment.yamlto only be created whentimmis used in the model
- Creates a
Minor:
- Change docstrings so the documentation API is built correctly
Bugs fixed:
- Fix minor error that was forcing some models to return a dictionary due to the contrastive learning code added previously
- Fix a bug in contrastive learning
- Fix
Z_DOWNhandling forHRNet - Adapt
HRNetto prediction by chunks - Restrict padding in chunked data generator to avoid edge case errors
- Transpose extra 3D image and mask in generator. Needed for CutMix.
- Change last_block in
multiresunetas it was before - Correct a bug in
pair_base_data_generator.py
Full Changelog: v3.6.3...v3.6.4
Version 3.6.3
Major:
- Do not force
numpy>2, just relax it withnumpy>1.26so thepyproject.tomlcan is coherent with the upcoming conda package
Minor:
- Relax test 4 check
Bugs fixed:
- Fix bug in SSL workflow
- Fix bug in Dockerfile due to conda TOS approval that must be done non-interactively
Full Changelog: v3.6.2...v3.6.3
Version 3.6.2
Major:
- Update notebooks to install version 3.6.1
- Add contrastive learning and HRNet
- Update models to return a
dictif more than one output are returned - Go back to the surface_area and sphericity calculation to avoid installing
diplibpackage as it does not support some macOS version plus they have no conda package for it. Mainly done to be able to create a conda package and streamline the installation process. This will help to implement the plugin for Fiji and integrate BiaPy in Galaxy.
Minor:
- Add aux script to remap cityscape dataset label remapping
- Add "superresolution" tag for BMZ models
- Add
timm,torchmetricsandpytorch-msssimtopyproject.toml MODEL.N_CLASSESrenamed intoDATA.N_CLASSES- Add a message when checking the
DATA.PATCH_SIZEin the loaded configuration and model, as lower values may raise an error when building/using that model - Correcting some of the descriptions in some functions to avoid compiling errors in the documentation building process
- Update installation in the code consistency CI
Bugs fixed:
- Fix bug in PatchCoords print function
- Solve bug in fixed mean/std normalization
- Move the translation of old config into the new one for the loaded cfg from the checkpoint
- Fix Dockerfile errors due to the last TOS changes in conda
Full Changelog: v3.6.1...v3.6.2
Version 3.6.1
Minor:
- Disable painting matching instances by default as it takes a lot of time, i.e.
TEST.MATCHING_STATS_THS_COLORED_IMGto[](#135) - Refine DA notebook
- Update notebooks to install BiaPy
v3.6.0
Bugs fixed:
- Fix minor issue when creating the
prediction.csvfile in classification workflow
Full Changelog: v3.6.0...v3.6.1
Version 3.6.0
Major:
- Transition to
numpy2 (#134) - Update notebooks by removing the cell that restarts the kernel, as it is no longer necessary after the transition to NumPy 2.
- Changing default normalization to
‘zero_mean_unit_variance’ - imgaug dependency removal by implementing the transformations we were using directly in BiaPy (#134)
Minor:
- Renamed
REMOVE_CLOSE_POST_POINTS_RADIUS_BY_MASKtoREMOVE_CLOSE_POINTS_RADIUS_BY_MASKso it’s more general and to be used with pre points too - Add num_workers information for test generator
- Improve classification message when expected classes and number of folder does not match (#124)
- Change all os.walk functions to os_walk_clean so the hidden files/dirs are not listed (#125)
- Add support to n5 files
- Add
MODEL.SKIP_UNMATCHED_LAYERSvariable to allow finetune models without no SSL workflow pretraining (#132) - Add check in 3D data cropping to not allow padding greater than half of the patch size
- Try to capture tiff metadata automatically to determine axis order
- Limit
zarrto be under3.0until it is more developed - Fix
timmversion to1.0.14as in1.0.15there are some errors when calling the ViT forward function. Check thattest20is working whenever we want to update the version - Add a script to repair the notebooks so they can be visualized in Github
Bugs fixed:
- Avoid errors when no post-points are detected during synapse detection
- Adapt histogram matching to new output from
load_data_from_dirmethod - Add test data check for classification in check_configuration.py (#124)
- Add the old
AUGMENTOR.AFFINE_MODEandDATA.NORMALIZATION.CUSTOM_MODEkey conversion to the current config version - Move
model.eval()before BMZ input/output creation in test - Delete old
DATA.NORMALIZATION.APPLICATION_MODEduring cfg translation to the current version - Only write pre/post csv files if at least one point is found
- Fix bug for semantic segmentation with more than 2 classes
- Fix bug when loading prediction files when using
MODEL.REUSE_PREDICTIONS, the stored prediction files are always of '.tif' extension (as created by thesave_tifmethod). - Add div normalization in SR templates as the default normalization was changed it needs to be explicitly specified.
- Add normalization instructions to classification workflow data load
Full Changelog: v3.5.13...v3.6.0
Version 3.5.13
Major:
- Completely restructure the inference by chunks (closing #91):
- A custom Pytorch dataloader is used to speed up the process taking into account number of workers and multiple GPUs
- Now this inference always creates a Zarr, even if the inputs are H5 files, thus,
TEST.BY_CHUNKS.FORMATwas removed - Now to division mask is needed, speeding up the process and saving disk space
- Complete synapse detection pipeline by adding metrics, debug files, etc. Now it should not be experimental anymore
- Add remove close points by distance+mask as post-processing for the synapses (
remove_close_points_by_maskfunction)
Minor:
- Add two optional cells in the inference notebook to transform 3D images/videos into 2D images, and the inverse task after prediction. This allows the users to process 3D data using a 2D model (closing #115)
- Add
Bchannel in synapse segmentation - Merge train/test/val instance creation into one function
- Add
zarr_to_tif.pyutility script - Change
SYSTEM.NUM_WORKERSdefault value to-1and remove it from all templates (closing #114). - Make
ensure_3d_shapefunction more robust andwrite_chunked_datato write in'ZYXC' axes order always - Move activations into
model_callfunction, removing redundant code (closing #110) - Add new losses description in
SR,SSLandI2Iworkflows - Add option to ignore a value in instance masks (still experimental)
- Add
TEST.DET_TH_TYPEoption - Add
PROBLEM.INSTANCE_SEG.SYNAPSES.TH_TYPEoption - Add a new feature to export the calculated metrics into a CSV file (closing #116 and #117)
- Change the way saved cfg in checkpoint is merged with the current cfg (now it is more robust as the cfg is always translated into the current version)
- Move to
bioimageio.core==0.8.0version - Update notebooks:
- Move installation up to restart notebook after reinstalling numpy
- Update BMZ cell with latest fields
Bugs fixed:
- Disable norm by image when using Zarr/H5 images
- Fix error when instances were generated using a Zarr/H5, as the axes need to be modified always in the next runs so the user does not need to know how the data was created/axes order
- Solve minor bug in blocks.py that lead to errors while building U-Next models.
- Ensure only the input cfg is copied one time in DDP setting
- Solve problem in during shape mismatch check
- Avoid copying
gt_associated_idalways, reducing the amount of memory for training - Make ensemble functions work as before returning a
torch.Tensor - Reduce the code in
I2Iworkflow reusingpredict_batches_in_test - Remove
convert_old_model_cfg_to_current_versionfrommisc.pyso to use the one frombiapy.engine.check_configurationinstead - Add
MODEL.BMZ.EXPORT.DATASET_INFOwhen converting the an old cfg into the current version - Fix error during old cfg conversion with
PATHS.LWR_Y_FILEold key - Relax
test25constraints and fixDapi_datasetpath - Correct
load_data_from_dirfunction converting it to the way we load data before by just giving a path (closing #109) - Solve
diff_between_configsfunction - Solve edge problem with
by_chunks_collate_fnfunction - Adapt chunks size of the of the Zarr to be created in by chunks setting by transposing the axes into the Zarr axe order
Full Changelog: v3.5.12...v3.5.13