Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
fail-fast: false
matrix:
kornia-ref: ['main'] # TODO: coverage check through multiple versions: , 'v0.7.1', 'v0.7.0']
pytorch-version: ['2.14.0']
torchvision-version: ['0.29.0']
pytorch-version: ['2.15.0']
torchvision-version: ['0.29.2']

steps:
- uses: kornia/workflows/.github/actions/env@v1.13.0
Expand Down Expand Up @@ -66,8 +66,8 @@ jobs:
matrix:
os: ['ubuntu']
kornia-ref: ['main']
pytorch-version: ['2.14.0']
torchvision-version: ['0.29.0']
pytorch-version: ['2.15.0']
torchvision-version: ['0.29.2']

steps:
- uses: kornia/workflows/.github/actions/env@v1.13.0
Expand Down
17 changes: 14 additions & 3 deletions nbs/adaptive_discriminator_augmentation_preset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@
"outputs": [],
"source": [
"panda_image = kornia.image_to_tensor(np.array(Image.open(\"panda.jpg\").convert(\"RGB\"))).float() / 255.0 # C, H, W\n",
"# the image is wider than tall: keep its central square, see the note on the default augmentations below\n",
"side = min(panda_image.shape[-2:])\n",
"panda_image = K.CenterCrop((side, side))(panda_image)[0]\n",
"panda_images = panda_image.unsqueeze(0).repeat(8, 1, 1, 1) # 8, C, H, W\n",
"\n",
"\n",
Expand Down Expand Up @@ -217,7 +220,9 @@
"id": "exUbjcCQX2Q4"
},
"source": [
"we can use the `AdaptiveDiscriminatorAugmentation` API with the default list of augmentations or using a custom list, starting with the default ones in this example"
"we can use the `AdaptiveDiscriminatorAugmentation` API with the default list of augmentations or using a custom list, starting with the default ones in this example\n",
"\n",
"**note:** the default list contains `RandomRotation90(times=(0, 3))`, which raises a `ValueError` on a non-square image because an odd number of quarter turns would cut part of it off, so the default list needs square images"
]
},
{
Expand Down Expand Up @@ -492,7 +497,8 @@
"- adjustment speed is set to a slightly high value\n",
"- `p` is updated each step\n",
"- target real accuracy for the *Discriminator* to maintain is 0.6\n",
"- the exponentially moving average lambda set to `0.5` to have an observable evolution of `p` over relatively few steps"
"- the exponentially moving average lambda set to `0.5` to have an observable evolution of `p` over relatively few steps\n",
"- the images are 64 x 128, not square, so instead of the default augmentations we pass the same list with half turns in place of quarter turns"
]
},
{
Expand All @@ -510,7 +516,12 @@
"outputs": [],
"source": [
"ada = AdaptiveDiscriminatorAugmentation(\n",
" # you can pass the custom augmentations you want to use here,\n",
" K.RandomHorizontalFlip(p=1.0),\n",
" K.RandomRotation90(times=(2, 2), p=0.5),\n",
" K.RandomErasing(scale=(0.02, 0.33), ratio=(0.3, 3.3), p=0.9),\n",
" K.RandomAffine(degrees=10, translate=(0.1, 0.1), scale=(0.9, 1.1), p=1.0),\n",
" K.ColorJitter(brightness=0.2, contrast=0.2, saturation=0.2, hue=0.1, p=1.0),\n",
" K.RandomGaussianNoise(std=0.1, p=1.0),\n",
" adjustment_speed=0.05,\n",
" update_every=1,\n",
" target_real_acc=0.6,\n",
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pytorch_lightning
rawpy
ray[data]
tensorboard
torch>=2.14.0
torch>=2.15.0
torchmetrics
torchvision>=0.29.0
torchvision>=0.29.2
tqdm
Loading