All tutorials
    Computer Vision
    Intermediate
    40 min

    Neural Style Transfer

    Apply artistic styles from famous paintings to your photos using convolutional neural networks.

    Extract Features

    python
    import torchimport torchvision.models as models vgg = models.vgg19(pretrained=True).features.eval() def get_features(image, model, layers=None):    if layers is None:        layers = {'0': 'conv1_1', '5': 'conv2_1',                  '10': 'conv3_1', '19': 'conv4_1', '28': 'conv5_1'}    features = {}    x = image    for name, layer in model._modules.items():        x = layer(x)        if name in layers:            features[layers[name]] = x    return features

    Try it in DLWΛY

    Open the Studio and follow along in a real project. There is nothing to install.

    Open Studio