From b60810a8b6b2b250b3018d39ce61c56cb7963036 Mon Sep 17 00:00:00 2001 From: Simon Alibert Date: Fri, 7 Jun 2024 10:55:18 +0000 Subject: [PATCH] Update config doc --- lerobot/common/datasets/transforms.py | 2 +- lerobot/configs/default.yaml | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lerobot/common/datasets/transforms.py b/lerobot/common/datasets/transforms.py index 5a1064bb..78282a1f 100644 --- a/lerobot/common/datasets/transforms.py +++ b/lerobot/common/datasets/transforms.py @@ -75,7 +75,7 @@ class RandomSubsetApply(Transform): class RangeRandomSharpness(Transform): - """Similar to RandomAdjustSharpness but with p=1 and a sharpness_factor sampled randomly + """Similar to v2.RandomAdjustSharpness but with p=1 and a sharpness_factor sampled randomly each time in [range_min, range_max]. If the input is a :class:`torch.Tensor`, diff --git a/lerobot/configs/default.yaml b/lerobot/configs/default.yaml index e30fb638..a5c58e1f 100644 --- a/lerobot/configs/default.yaml +++ b/lerobot/configs/default.yaml @@ -59,14 +59,23 @@ wandb: notes: "" image_transforms: - # brigthness, contrast, saturation and hue are instances of torchvision Colorjitter, sharpness is an instance of custom class - enable: true - # A subset of these transforms will be applied for each batch. This is the maximum size of that subset. + # These transforms are all using standard torchvision.transforms.v2 + # You can find out how these transformations affect images here: + # https://pytorch.org/vision/0.18/auto_examples/transforms/plot_transforms_illustrations.html + # We use a custom RandomSubsetApply container to sample them. + # For each transform, the following parameters are available: + # weight: This represents the multinomial probability (with no replacement) + # used for sampling the transform. If the sum of the weights is not 1, + # they will be normalized. + # min/max: Lower & upper bound respectively used for sampling the transform's parameter + # (following uniform distribution) when it's applied. + enable: false + # This is the number of transforms (sampled from these below) that will be applied to each frame. + # It's an integer in the interval [0, number of available transforms]. max_num_transforms: 3 - # Torchvision suggest applying the transforms in the following order : brightness, contrast, saturation, hue - # sharpness can be applied at any time before or after (we choose after). + # By default, transforms are applied in Torchvision's suggested order (shown below). + # Set this to True to apply them in a random order. random_order: false - # Randomply samples transform parameters from the range [min, max]. The weight is used to determine the relative probability of applying the transform. brightness: weight: 1 min: 0.8 @@ -79,7 +88,6 @@ image_transforms: weight: 1 min: 0.5 max: 1.5 - # hue is a rotation in degrees. The maximum range is [-0.5, 0.5] but we use [-0.05, 0.05] to avoid extreme unnecessary changes. hue: weight: 1 min: -0.05