Skip to content

Releases: Project-AgML/AgML

AgML 0.4.5

31 Oct 22:33
Compare
Choose a tag to compare

This feature adds a couple of new features as well as bugfixes for the existing API.

Main Changes

  • You can now use image classification models (agml.models.ClassificationModel) as image regression models by passing regression = True upon instantiation. This drops the final argmax computation and returns the softmax regression values.
  • Pass a custom set of RGB values to agml.viz.set_colormap to use a custom colormap.
  • A new preprocessing function has been added to agml.models.preprocessing: agml.models.preprocessing.imagenet_preprocess, which prepares images for input to an ImageNet-backend model (image classification, semantic segmentation).

Bugfixes

  • The MeanAveragePrecision metric has been fixed, and no longer throws errors for empty predictions (or for early-stage training results).
  • Custom object detection datasets can now be auto-loaded and classes automatically inferred without throwing an error.

Read the Full Changelog Here.

AgML 0.4.4

14 Oct 15:12
ef78bc1
Compare
Choose a tag to compare

This release introduces a number of updates and bugfixes.

Main Changes

agml.synthetic

  • Helios compilation has now been optimized, meaning that canopy generation speed should be increased by 3 to 5 times.
  • When using HeliosOptions.camera.generate_positions(), camera views are no longer angled by default.

agml.models

  • The agml.models.ClassificationModel is now initialized with num_classes, rather than a dataset name.
  • For the agml.models.SegmentationModel.predict() method, a new argument, overlay, has been added, which allows the resulting segmentation mask to be overlaid or displayed side-by-side.

agml.viz

  • A new method has been added, agml.viz.convert_figure_to_image(), which converts the in-built Matplotlib figure when using agml.viz methods into an image array.

Read the Full Changelog Here.

AgML 0.4.3

02 Oct 21:56
Compare
Choose a tag to compare

This release contains additional bugfixes for Helios installation and compilation.

AgML 0.4.2

02 Oct 14:48
Compare
Choose a tag to compare

This release fixes installation problems when installing Helios.

Bugfixes

  • Helios will now auto-install when running any configuration or compilation methods, rather than throwing an installation error.
  • The installation script which fetches Helios is now correctly included with the package.

Note: AgML v0.4.1 contains a partial fix of these errors, so please use this version instead. This GitHub release collapses v0.4.1 and v0.4.2 into a single release.

AgML 0.4.0

28 Sep 18:05
d4fc61a
Compare
Choose a tag to compare

This is the first release in the AgML v0.4.x cycle, introducing the agml.synthetic module backed by the Helios API (https://baileylab.ucdavis.edu/software/helios/) for generating synthetic agricultural data.

API Changes

agml.synthetic

  • Introduction of the agml.synthetic module.
  • Generate data using the agml.synthetic.HeliosDataGenerator.
    • Customize generated data, including task, environment, and canopy parameters, using agml.synthetic.HeliosOptions.
    • Convert data between the Helios and AgML formats automatically upon generation.
  • Customize the compilation of Helios using agml.synthetic.recompile_helios.
  • Get default parameters and information using agml.synthetic.available_canopies() and agml.synthetic.default_canopy_parameters().

agml.data

  • Load Helios-generated synthetic datasets using agml.data.AgMLDataLoader.helios().

agml.viz

  • Added new inspection methods for synthetic data:
    • agml.viz.plot_synthetic_camera_positions creates a 3D plot from camera position and lookat vectors, to understand the geometry of the environment.
    • agml.viz.vizualize_all_views plots all of the views for a specific generated canopy.

agml.backend

  • Similar to the methods for public datasets and models, synthetic datasets can be generated to a specific path by using agml.backend.set_synthetic_save_path(), and retrieved using agml.backend.synthetic_save_path().

Read The Full Changelog Here

AgML 0.3.0

19 Aug 14:55
Compare
Choose a tag to compare

This is the first release in AgML v0.3.x cycle, introducing the agml.models module.

API Changes

agml.models

  • Introduction of the agml.models module. To load the module, include an import agml.models statement after the standard import agml.
  • Construct inference models for the following tasks:
    • image classification: agml.models.ClassificationModel (using an EfficientNetB4 model)
    • semantic segmentation: agml.models.SegmentationModel (using a DeepLabV3 model)
    • object detection: agml.models.DetectionModel (using an EfficientDetD4 model)
  • Use model.predict on an input data sample to get the prediction results, or use model.show_prediction to visualize the prediction for semantic segmentation and object detection datasets.
  • Use model.preprocess_input to format inputs in the required format for each model.
  • Load a pretrained benchmark for an AgML public dataset using model.load_benchmark.
    • Currently available for semantic segmentation and object detection.
    • Print information about the benchmark metric and training parameter using the model.benchmark property.
  • Evaluate a model using standard metrics using model.evaluate() with an AgMLDataLoader
  • Standard metric containers using the agml.models.metrics module: currently with Accuracy for image classification and MeanAveragePrecision for object detection.
  • Preprocessing pipelines using agml.models.preprocessing: currently with EfficientDetPreprocessor for object detection models.
  • Standard loss functions with agml.models.losses: currently with DiceLoss for semantic segmentation.

agml.data

  • Load multiple datasets into a single AgMLDataLoader using the new Sequence API: agml.data.AgMLDataLoader([<d1>, <d2>]).
  • Load custom datasets into an AgMLDataLoader using agml.data.AgMLDataLoader.custom(<d>).
  • Merge two loaders into a single AgMLDataLoader using agml.data.AgMLDataLoader.merge(<l1>, <l2>).
  • Copy the state of another AgMLDataLoader using agml.data.AgMLDataLoader.copy_state(<d>). This copies the states of the internal managers, so the original loader will get the transforms, resizing, and training mode of the copied loader.
  • New Dataset Reduction Methods:
    • Use loader.take_random to select a random number of data samples from the loader and return a new loader with this reduced number of samples.
    • Use loader.take_class on a multi-dataset object detection AgMLDataLoader to return a reduced loader containing all samples belonging to the specific class (or multiple classes).
    • Use loader.take_dataset on a multi-dataset AgMLDataLoader to return one of the individual loaders in the collection.
  • Preprocessing Changes:
    • Select a custom method for image resizing using the method keyword argument in AgMLDataLoader.resize_images().
    • You can update whether the loader should be auto-shuffled internally through the shuffle_data property (set to True or False).
    • Semantic segmentation loaders now have an option loader.mask_to_channel_basis (the parallel of loader.labels_to_one_hot for image classification), which converts one-channel masks to multi-channel masks with each channel representing a binary mask for a class.
    • For multi-dataset object detection loaders, the loader.generalize_class_detections method generalizes all classes, thus resulting in the loader having only one-class (useful for localization-intensive tasks).
    • The agml.data.convert_bbox_format method now allows you to pass string formats, e.g., pascal-voc or efficientdet: these get auto-expanded to the full bounding box format in the method itself.

agml.backend

  • Similar to the method for datasets, models can now be saved to a specific path using agml.backend.set_model_save_path() and this path can be retrieved using agml.backend.model_save_path().
  • A new agml.backend.experimental module has been added for experimental features.
    • Currently, the first experimental feature is splitting already-split loaders, with agml.backend.experimental.allow_nested_data_splitting().

agml.viz

  • New methods have been introduced which allow visualization of real and predicted samples:
    • Visualize real and predicted bounding boxes with agml.viz.visualize_real_and_predicted_boxes.
    • Visualize an image with multiple sets of bounding boxes using agml.viz.visualize_image_and_many_boxes.
    • Visualize a real and predicted semantic segmentation mask with agml.viz.visualize_image_mask_and_predicted.

Behavior Changes

  • The AgMLDataLoader now has a set of new properties (num_images, num_classes, etc). These are similar to the properties loader.info.num_images, loader.images.num_classes, etc., however, the properties directly on the loader reflect any changes applied to reduction methods.
    • For instance, if you call loader.split(), then the reduced loader.train_data loader will have a reduced number of loader.num_images, while loader.info.num_images will continue to reflect the total number of images for the original dataset.
  • Dataset transforms are now tracked by their time of insertion; if you call loader.transform() twice, the transforms which are passed in the first call will be applied before those in the second call.
  • Any methods which use random operations (such as loader.take_random) now have an optional random_state keyword argument, which can be passed to control the random seed used for that method only.
  • All transformation methods now have an optional argument add which allows them to be disabled.
  • When converting an AgMLDataLoader into training mode, it now disables the auto mode so that no inadvertent resizing is done unless the user explicitly requests it.
  • In all agml.viz methods, image arrays are auto-converted to 8-bit unsigned integer format before display. Additionally, the format_image method now takes an additional argument mask for preprocessing masks.
  • Array check methods now check for NumPy arrays and lists, before PyTorch tensors, before finally TensorFlow tensors: this prevents having to load in the full API for PyTorch/TensorFlow modules when unnecessary.

Other Bugfixes

  • Bounding boxes for object datasets are now clipped at [0, image_size) on loading.
  • Exporting COCO datasets from a split AgMLDataLoader now returns the correct, reduced COCO JSON dictionary, rather than the entire dataset's COCO JSON.
  • Copying a loader or splitting it will now update all internal states; previously there was a chance the TrainingManager would have different resize/transform managers than the upper-level DataManager.
  • You can now download a list of datasets using agml.data.download_public_dataset.
  • When visualizing semantic segmentation masks with no class labels (e.g., a prediction with only zeros), now only the original image is displayed, rather than throwing an error.
  • An error with namedtuples in local scopes which prevented AgMLMetadata from being serialized has been resolved.

Read the Full Changelog Here.

AgML 0.2.9

09 Aug 15:29
Compare
Choose a tag to compare

This release fixes a small breaking change, updating the AWS download URL for datasets.

AgML 0.2.8

31 May 05:09
Compare
Choose a tag to compare

This release introduces three new semantic segmentation datasets:

  1. peachpear_flower_segmentation
  2. red_grapes_and_leaves_segmentation
  3. white_grapes_and_leaves_segmentation

Read the Full Changelog Here.

AgML 0.2.7

18 Apr 15:29
e8e2e13
Compare
Choose a tag to compare

This release introduces two new object detection datasets: plant_doc_detection and wheat_head_counting.

In addition, a number of fixes have been made to existing datasets:

  • plant_doc_classification: Class names have been updated.
  • fruit_detection_worldwide: Class indexing has been redone from 1 instead of 0 (to fit the object detection standard).
  • apple_detection_usa: There was an issue where multiple images had the same ID, this has been fixed so each image has a unique ID.
  • rice_seedling_segmentation: Removed the redundant background class and re-indexed from 1.

Read the Full Changelog Here.

AgML 0.2.6

10 Mar 23:13
Compare
Choose a tag to compare

This is a bugfix-oriented release. The biggest new change is the removal of the cotton_seedling_counting dataset.

Bugfixes

  1. Fixed an issue regarding splitting datasets using proportions (float values).
  2. Updated the number of images in plant_seedlings_aarhus to reflect the actual count.
  3. Updated the error message displayed when accessing nonexistent metadata.