Breaking changes

  • model_maskrcnn_*() now return image-sized mask probabilities in masks, shape (N, H, W) (@sebffischer, #412). Code that used the per-box (N, 28, 28) probabilities should read output$detections[[1]]$mask_probs instead of output$detections[[1]]$masks. For image overlays, use output$detections[[1]]$masks > 0.5.
  • State dictionaries saved with torchvision 0.9.0 need migration for model_vit_*(), model_facenet_inception_resnet_v1(), model_convnext_*_upernet(), model_fasterrcnn_resnet50_fpn_v2() and model_maskrcnn_resnet50_fpn_v2(): parameters were added, removed or renamed, so these checkpoints cannot be loaded unchanged with strict = TRUE (#405, #406, #410, #412). RF-DETR checkpoints from earlier development versions may also need migration after changes to decoder depths and resolutions (#413). There is no automatic migration for user-saved checkpoints. Keep the package version that created them, or explicitly migrate and validate the weights. model_maxvit() retains its state-dict keys and shapes, but its corrected forward computation can change predictions (#405). Support for the hosted pretrained weights does not imply compatibility with user-saved checkpoints.
  • When supplied, draw_bounding_boxes() labels and colors must have length 1 or match the number of original boxes. Partial recycling is no longer supported (#415).

New models

  • Added RF-DETR model family: model_rfdetr_*, with * being nano(), small(), medium(), base(), base_2(), base_o365() and large() for real-time object detection with DINOv2 backbone and deformable-attention decoder (@DerrickUnleashed, #327).
  • Added LW-DETR model family: model_lw_detr_*, with * being tiny(), small(), medium() and large() for real-time object detection with ViT backbone and deformable-attention decoder (@srishtiii28, #328).

New datasets

New features

Bug fixes and improvements

  • draw_bounding_boxes() now keeps labels and colors aligned with their boxes when lazy = TRUE filters out degenerate boxes (#415).
  • Fixed box alignment in padded center crops and random crops, and corrected five- and ten-crop geometry (#414).
  • model_vit_*() predictions now depend on the input image: attention runs over the patches of each image, the positional embedding is registered so it is loaded from the pretrained weights, and layer norm uses eps = 1e-6 (@sebffischer, #405).
  • model_maxvit() is re-ported from PyTorch and now reproduces its predictions with the pretrained weights (@sebffischer, #405).
  • draw_bounding_boxes() now accepts degenerate bounding boxes by default with the lazy = TRUE parameter (#400).
  • vision_make_grid() now accepts multiple 3D tensors with mixed uint8 and float dtype, while preserving positional scale, num_rows, padding and pad_value arguments (#398). Use per_row for the number of images per row; named num_rows remains supported as a deprecated alias.
  • transform_random_affine() now accepts a bare number for shear. It used to widen degrees instead of shear, which left the shear range incomplete and made the sampling fail (#390).
  • item_transform_rotate() no longer truncates the rotation angle to a whole number of degrees when the target stores its boxes as an integer tensor, as pascal_detection_dataset() does (#360).
  • transform_random_resized_crop() no longer loses the last row and column of the image, and no longer pads with a black edge when it falls back to a central crop (#386).
  • transform_crop() now pads the result with zeros when the crop leaves the image, so that the output always has the requested size. It previously returned only the part of the image the crop covered, which could even be empty.
  • transform_center_crop() now pads correctly when the requested size is not square. Height and width were used in the wrong order in the padding branch, so e.g. cropping a (16, 20) image to c(24, 30) returned a (22, 0) image.
  • transform_rgb_to_grayscale() now returns an image with one channel instead of dropping the channel dimension, i.e. (3, H, W) becomes (1, H, W) and not (H, W). This also fixes transform_grayscale() for batched input.
  • hsv2rgb() computed the fractional part of the hue sector and the t component incorrectly, so converting an image to HSV and back did not return the original image. This affected transform_adjust_hue() and transform_color_jitter(hue = ...).
  • transform_adjust_hue() now handles negative hue_factors, which produced a black image before, and rejects images that do not have 1 or 3 channels instead of silently dropping the additional ones.
  • nms() now uses torchvisionlib::ops_nms() when torchvisionlib is installed, speeding up inference for model_fasterrcnn_*() and model_maskrcnn_*() (#321, #322).
  • Lists and vectors are now preallocated to their target size instead of being grown one element at a time (@srishtiii28, #335).
  • model_convnext_small_22k1k() now defaults to num_classes = 1000. It is pretrained on Imagenet 22k and fine-tuned on Imagenet 1k, so its published weights have a 1000-class head, and the previous default of 21841 made pretrained = TRUE fail to load the state dict. (@sebffischer, #376)
  • model_inception_v3(pretrained = TRUE, aux_logits = FALSE) now actually removes the auxiliary classifier. Previously aux_logits = FALSE was silently ignored for pretrained models, so the network returned a list of both heads instead of a single tensor in training mode. (@sebffischer, #375)
  • model_rfdetr_*() now match the reference rf-detr implementation numerically, accept padding masks, and use the official configurations of the small, medium and base variants (@sebffischer, #413).
  • model_fasterrcnn_*() and model_maskrcnn_*() inference now reproduces torchvision numerically, supports batches, and loads pretrained weights strictly (@sebffischer, #412).
  • model_inception_v3() and model_resnet*() without pretrained weights now initialise all layers as in PyTorch, and zero_init_residual = TRUE takes effect (@sebffischer, #411).
  • The progress argument of the model constructors is now honoured (@sebffischer, #411).
  • model_convnext_*_upernet() now apply the per-stage layer norms of the pretrained backbone and default to num_classes = 150 when pretrained = TRUE (@sebffischer, #410).
  • model_convnext_*_detection() default to num_classes = 90 and pass score_thresh, nms_thresh and detections_per_img to the detection head (@sebffischer, #410).
  • model_convnext_*() blocks now apply stochastic depth in training mode (@sebffischer, #410).
  • model_efficientnet_*() and model_efficientnet_v2_*() now match torchvision (SiLU squeeze-excitation, batch norm settings), apply stochastic depth in training, and accept dropout without shifting other arguments (@sebffischer, #409).
  • model_mobilenet_v3_*() use torchvision’s batch norm settings, gain a norm_layer argument and stay in training mode when pretrained = FALSE; model_mobilenet_v2() handles stages with n = 0 (@sebffischer, #409).
  • model_fcn_resnet*() now use a dilated backbone as in PyTorch, fixing the pretrained segmentations, and no longer download the backbone weights when pretrained = TRUE (@sebffischer, #408).
  • model_deeplabv3_*() keep the auxiliary classifier when pretrained = TRUE and aux_loss = NULL, as documented (@sebffischer, #408).
  • model_lw_detr_*() now match the reference LW-DETR implementation numerically, which strongly improves the pretrained detections (@sebffischer, #407).
  • model_facenet_pnet(), model_facenet_rnet(), model_facenet_onet() and model_mtcnn() take the face softmax over the class dimension instead of the batch dimension (@sebffischer, #406).
  • model_facenet_inception_resnet_v1() now matches facenet-pytorch (missing repeat_1 stage, Mixed_6a paddings); pretrained = TRUE loads "vggface2" and num_classes defaults to NULL (@sebffischer, #406).

Breaking changes

New features

New models

New datasets

Bug fixes and improvements

  • model_maskrcnn_*() and model_fasterrcnn_*() now match the pytorch implementation (#318).
  • transform_ now correctly manage batched 4D torch tensors and 4D arrays (#313).
  • mnist_datataset() and derivatives now correctly return item x() values with a 1-channel dimension (@Chandraveersingh1717, #307).
  • transform_affine(), transform_rotate() and random derivatives now use interpolation and fill parameter in favor of resampleand fillcolor (@Chandraveersingh1717, #299).
  • Fixed draw_keypoints() documentation and error message (@srishtiii28, #296).
  • Standardized dataset messages: download messages now include split information, success messages show image count and class count for consistency.
  • fix model_fasterrcnn_* did not provide boxes output normalized to image size, did not manage batches, fix performance of the roi_align() function (#284).
  • fix rf100 collection bounding-box now consider the correct native COCO format being ‘xywh’ (#272).
  • Remove .getbatch method from MNIST as it is providing inconsistent tensor dimensions with .getitem due to non-vectorized transform_ operations (#264).
  • Added article for draw_keypoints() (@DerrickUnleashed, #303).
  • Fix typos and align model documentation for model_deeplabv3_* and model_convnext_*_detection() to ensure consistency (@DerrickUnleashed #302).
  • Fixed draw_keypoints() documentation: corrected connectivity parameter type, obsolete note, colors description default (@srishtiii28 #296).

New datasets

New models

New features

Bug fixes and improvements

  • Switch pre 0.5.0 models to their /v2/ URL in torch-cdn.mlverse.org. (#215)
  • Models are now separated in the documentation by tasks between classification, object detection, and semantic segmentation models (@cregouby, #247)
  • Breaking Change : Refactoring of coco_* dataset family now provides each item$x being an image array (for consistency with other datasets). You can use transform = transform_to_tensor to restore the previous x output to be a torch_tensor().
  • transform_ are now documented into 3 different categories: unitary transformations, random transformations and combining transformations. (@cregouby, #250)
  • Deprecation : emnist_dataset is deprecated in favor of emnist_collection() (@cregouby, #260).

New datasets

New models

New features

Minor bug fixes and improvements

  • Remove again dependency on zip::unzip added in version 0.4.0. (#89)
  • Improve performance on tinyimagenet-alexnet example (#90, @statist-bhfz)
  • Updated URL of downloaded resources to use the new torch CDN. (#109)
  • Remove usage of torch_lstsq that was removed in torch v0.10.0
  • Implemented MobileNetV2 (#60)
  • Improved vignettes so they use nnf_cross_entropy for numerical stability. (#61)
  • Implement the full list of ResNet model family (#66, @cregouby)
  • Improved how datasets and models are downloaded by using a large timeout by default and downloading to temporary file to avoid hard to debug errors when the files are corrupt. (#67)
  • Added a dependency on zip to zip::unzip the tinyimagenet dataset.
  • Removed all usages of torch::enumerate() from docs and tests in favor of coro::loop() (#57)
  • Fixed non-namespaced calls to torch. (#58)
  • Use a self hosted version of the MNIST dataset to avoid frequent download failures. (#48)
  • Fix torch_arange calls after breaking change in torch. (#47)
  • Fix bug in transform_resize when passing size with length 1. (#49)
  • Fixed bugs in transform_rotate. (#31)
  • Fixed bugs in transform_random_affine and transform_affine (#32)
  • Added VGG model (#35)
  • Added a NEWS.md file to track changes to the package.