Exemplo n.º 1
0
STYLE_WEIGHT = 1e8
EDGE_WEIGHT = [1e8, 5e8, 1e9]
EDGE_THRESHOLD = 0.9

from cast import ExperimentRun, perform_transfer, Vgg16, get_device, save_image

CONTENT = [
    'bottles', 'car1', 'dark', 'foots', 'nat2', 'nature', 'photo1',
    'portrait1', 'portrait2', 'portrait3', 'portrait4', 'portrait5',
    'portrait6'
]

STYLES = ['abstract', 'abstract1', 'aqua0', 'aqua1', 'sketch']

exp = ExperimentRun('all_images_qsobel')

exp.dump_sources()

device = get_device()

vgg = Vgg16().to(device)

fails = []

for s in STYLES:
    for c in CONTENT:
        item_name = f'{s}__{c}'
        item_dir = exp.make_item_dir(item_name)
        content = exp.load_content(c, 512, item_dir)
        style = exp.load_style(s, 512, item_dir)
Exemplo n.º 2
0
from cast import ExperimentRun, get_device, Vgg16, perform_transfer, save_image

STYLE_CONTENT_PAIRS = [
    ("abstract", "details1"),
    ("abstract", "bottles"),
    ("candy", "details2"),
    ("la_muse", "details3"),
    ("la_muse", "portrait3"),
    ("modern_abstract", "details1")
]

exp = ExperimentRun('pooling_vs_threshold')

exp.dump_sources()

device = get_device()

vgg = Vgg16().to(device)

fails = []

for s, c in STYLE_CONTENT_PAIRS:
    item_name = f'{s}__{c}'

    if (exp.results_dir / item_name).exists():
        continue

    item_dir = exp.make_item_dir(item_name)
    content = exp.load_content(c, 512, item_dir)
    style = exp.load_style(s, 512, item_dir)
Exemplo n.º 3
0
    'portrait6',
    'portrait7',
    'portrait9',
    'portrait10',
    'portrait8',
    'bottles',
]

STYLES = [
    'aqua_puantilism_2', 'geometry13', 'candy', 'aqua0', 'hadrd_geometry',
    'abstract', 'oil_strikes', 'hard_geometry', 'la_muse', 'hard_geometry_2',
    'aqua1', 'modern_abstract', 'hard_geometry_3', 'mosaics5',
    'lowdetail_aqua', 'geometry_3d'
]

exp = ExperimentRun('lapstyle_vs_gatys_big')

exp.dump_sources()

device = get_device()

vgg = Vgg16().to(device)

fails = []

for s in STYLES:
    for c in CONTENT:
        item_name = f'{s}__{c}'

        if (exp.results_dir / item_name).exists():
            continue
Exemplo n.º 4
0
    ("abstract", "portrait1"),
    ("abstract", "portrait3"),
    ("aqua_puantilism_2", "details3"),
    ("aqua_puantilism_2", "portrait3"),
    ("aqua_puantilism_2", "portrait4"),
    ("smallworld", "boy"),
    ("candy", "bottles"),
    ("candy", "details3"),
    ("geometry13", "portrait9"),
    ("hadrd_geometry", "portrait5"),
    ("hadrd_geometry", "portrait9"),
    ("lowdetail_aqua", "portrait8"),
    ("lowdetail_aqua", "portrait9")
]

exp = ExperimentRun('scaling-lum_1')

exp.dump_sources()

device = get_device()

vgg = Vgg16().to(device)

fails = []

for s, c in STYLE_CONTENT_PAIRS:
    item_name = f'{s}__{c}'

    if (exp.results_dir / item_name).exists():
        continue
Exemplo n.º 5
0
CONTENT = [
    'details2',
    'details1',
    'portrait2',
    'portrait8',
]

STYLES = [
    'aqua_puantilism_2',
    'candy',
    'hadrd_geometry',
    'hard_geometry_2',
]

exp = ExperimentRun('qbsobel_sigma')

exp.dump_sources()

device = get_device()

vgg = Vgg16().to(device)

fails = []

for s in STYLES:
    for c in CONTENT:
        item_name = f'{s}__{c}'

        if (exp.results_dir / item_name).exists():
            continue
Exemplo n.º 6
0
    'bottles',
    'car1',
    'dark',
    'foots',
    'nat2',
    'nature',
    'photo1',
    'portrait1',
    'portrait2',
    'portrait3',
    'portrait4',
    'portrait5',
    'portrait6'
]

exp = ExperimentRun('sobel-histogram')
sobel = SobelFilter(angles=False)

for c in CONTENT:
    content = exp.load_content(c, size=512)

    contours = sobel(content)[0].numpy()

    plt.figure(121)
    plt.imshow(tensor2ndimage(content))
    plt.figure(122)
    plt.hist(contours.flatten(), bins=100)

    plt.savefig(exp.results_dir / f'{c}.png')
    plt.close()
Exemplo n.º 7
0
EDGE_THRESHOLD = 0.9

from cast import ExperimentRun, perform_transfer, Vgg16, get_device, save_image

CONTENT = [
    'megan',
    'boy',
    'goat',
]

STYLE = [
    'la_muse',
    'flowers',
    'smallworld',
]
exp = ExperimentRun('qsobel_lapstyle_samples')

exp.dump_sources()

device = get_device()

vgg = Vgg16().to(device)

fails = []

for s in STYLE:
    for c in CONTENT:
        item_name = f'{s}__{c}'

        if (exp.results_dir / item_name).exists():
            continue
Exemplo n.º 8
0
    ("abstract", "portrait1"),
    ("abstract", "portrait3"),
    ("aqua_puantilism_2", "details3"),
    ("aqua_puantilism_2", "portrait3"),
    ("aqua_puantilism_2", "portrait4"),
    ("smallworld", "boy"),
    ("candy", "bottles"),
    ("candy", "details3"),
    ("geometry13", "portrait9"),
    ("hadrd_geometry", "portrait5"),
    ("hadrd_geometry", "portrait9"),
    ("lowdetail_aqua", "portrait8"),
    ("lowdetail_aqua", "portrait9")
]

exp = ExperimentRun('sobel_gs_weight-1')

exp.dump_sources()

device = get_device()

vgg = Vgg16().to(device)

fails = []

for s, c in STYLE_CONTENT_PAIRS:
    item_name = f'{s}__{c}'

    if (exp.results_dir / item_name).exists():
        continue
Exemplo n.º 9
0
                       ("la_muse", "details3"), ("la_muse", "portrait3"),
                       ("modern_abstract", "details1"),
                       ("abstract", "bottles"), ("abstract", "details3"),
                       ("abstract", "details4"), ("abstract", "photo1"),
                       ("abstract", "portrait1"), ("abstract", "portrait3"),
                       ("aqua_puantilism_2", "details3"),
                       ("aqua_puantilism_2", "portrait3"),
                       ("aqua_puantilism_2", "portrait4"),
                       ("smallworld", "boy"), ("candy", "bottles"),
                       ("candy", "details3"), ("geometry13", "portrait9"),
                       ("hadrd_geometry", "portrait5"),
                       ("hadrd_geometry", "portrait9"),
                       ("lowdetail_aqua", "portrait8"),
                       ("lowdetail_aqua", "portrait9")]

exp = ExperimentRun('symm_vs_asymm')

exp.dump_sources()

device = get_device()

vgg = Vgg16().to(device)

fails = []

for s, c in STYLE_CONTENT_PAIRS:
    item_name = f'{s}__{c}'

    if (exp.results_dir / item_name).exists():
        continue
Exemplo n.º 10
0
STYLE_WEIGHT = 1e8
EDGE_WEIGHT = 1e9
EDGE_THRESHOLD = 0.5

from cast import ExperimentRun, perform_transfer, Vgg16, get_device, save_image

CONTENT = [
    'bottles', 'car1', 'dark', 'foots', 'nat2', 'nature', 'photo1',
    'portrait1', 'portrait2', 'portrait3', 'portrait4', 'portrait5',
    'portrait6'
]

STYLES = ['abstract', 'abstract1', 'aqua0', 'aqua1', 'sketch']

exp = ExperimentRun('all-images-versus-nonorm')

exp.dump_sources()

device = get_device()

vgg = Vgg16().to(device)

fails = []

for s in STYLES:
    for c in CONTENT:
        item_name = f'{s}__{c}'
        item_dir = exp.make_item_dir(item_name)
        content = exp.load_content(c, 512, item_dir)
        style = exp.load_style(s, 512, item_dir)