-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_style_transfer_table.py
52 lines (44 loc) · 1.73 KB
/
create_style_transfer_table.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import os
import glob
import argparse
import numpy as np
from scipy import misc
#from skimage import io, color
import random
def create_style_transfer():
idx = 0
dir_name = 'intel-ar'
for filename in glob.glob(os.path.join("images/" + dir_name + "/original/", "*.jpg")):
nameonly = os.path.basename(filename)
idx += 1
if random.random() < 0.0:
os.system('rm images/%s/original/%s' % (dir_name,nameonly))
os.system('rm images/%s/%s/%s' % (dir_name, 'ukiyoe', nameonly))
os.system('rm images/%s/%s/%s' % (dir_name, 'vangogh', nameonly))
os.system('rm images/%s/%s/%s' % (dir_name, 'cezanne', nameonly))
os.system('rm images/%s/%s/%s' % (dir_name, 'monet', nameonly))
else:
## Style transfer
print(("| %d | ![]({{site.baseurl}}/images/%s/original/%s) | ![]({{site.baseurl}}/images/%s/%s/%s) | ![]({{site.baseurl}}/images/%s/%s/%s) " +
"| ![]({{site.baseurl}}/images/%s/%s/%s) | ![]({{site.baseurl}}/images/%s/%s/%s) |") %
(idx, dir_name,nameonly,
dir_name, 'monet', nameonly,
dir_name, 'vangogh', nameonly,
dir_name, 'cezanne', nameonly,
dir_name, 'ukiyoe', nameonly,
))
def create_renoir2selfie():
idx = 0
dir_name = 'movie-to-renoir'
search_dir = os.path.join("images/" + dir_name + "/original/", "*.jpg")
print(search_dir)
for filename in glob.glob(search_dir):
nameonly = os.path.basename(filename)
idx += 1
## Style transfer
print(("| %d | ![]({{site.baseurl}}/images/%s/original/%s) | ![]({{site.baseurl}}/images/%s/%s/%s) | )" %
(idx, dir_name,nameonly,
dir_name, 'renoir', nameonly,
)))
#create_renoir2selfie()
create_style_transfer()