Skip to content
Run in Google Colab View notebook on GitHub

Weather augmentations in Albumentations

This notebook demonstrates weather augmentations that are supported by Albumentations.

Import the required libraries

import random

import cv2
from matplotlib import pyplot as plt

import albumentations as A

Define a function to visualize an image

def visualize(image):
    plt.figure(figsize=(20, 10))
    plt.axis('off')
    plt.imshow(image)

Load the image from the disk

image = cv2.imread('images/weather_example.jpg')
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

Visualize the original image

visualize(image)