Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
315 commits
Select commit Hold shift + click to select a range
07e4e37
Update README.md
bethanystate Jul 14, 2020
72146de
Set theme jekyll-theme-leap-day
bethanystate Jul 14, 2020
d03fab5
Create Gemfile
bethanystate Jul 15, 2020
4a15835
Update Gemfile
bethanystate Jul 15, 2020
79df017
Add files via upload
bethanystate Jul 15, 2020
58fd808
Create README_Saeed.md
rashidi1saeed Jul 15, 2020
03dff0f
Update README_Saeed.md
rashidi1saeed Jul 15, 2020
f342987
Rename Gemfile to Theme/Gemfile
bethanystate Jul 15, 2020
91273f1
Rename style.scss to Theme/style.scss
bethanystate Jul 15, 2020
eeb03cc
Delete Screen Shot 2020-07-14 at 4.05.34 PM.png
bethanystate Jul 15, 2020
b833907
Update README.md
bethanystate Jul 15, 2020
eb0285a
Rename Theme/style.scss to Theme/css/style.scss
bethanystate Jul 15, 2020
1ad3546
Update _config.yml
bethanystate Jul 15, 2020
d2ce131
Create style.scss
bethanystate Jul 15, 2020
f96483b
Delete style.scss
bethanystate Jul 15, 2020
ac492d1
Update style.scss
bethanystate Jul 15, 2020
5491096
Create default.html
bethanystate Jul 15, 2020
3ea1c08
Delete Gemfile
bethanystate Jul 15, 2020
ffdb8e1
Update README_Saeed.md
rashidi1saeed Jul 15, 2020
168cbb4
Update _config.yml
bethanystate Jul 15, 2020
eaf3e41
Update _config.yml
bethanystate Jul 15, 2020
673acb1
Rename evaluate.py to Implementation/evaluate.py
bethanystate Jul 15, 2020
f1c5a78
Rename test.py to Implementation/test.py
bethanystate Jul 15, 2020
f6833fa
Rename tfrecords.py to Implementation/tfrecords.py
bethanystate Jul 15, 2020
6046b01
Rename CycleGAN.ipynb to Implementation/CycleGAN.ipynb
bethanystate Jul 15, 2020
54d35f5
Update README_Saeed.md
rashidi1saeed Jul 15, 2020
6cacfd9
Update README_Saeed.md
rashidi1saeed Jul 15, 2020
e9d5242
Create jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
79878bc
Update README_Saeed.md
rashidi1saeed Jul 15, 2020
858ca97
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
6a148d6
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
e88e7d1
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
9297176
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
2f59a91
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
02dc1cf
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
af110bd
Create checkpoints
diwakar-vsingh Jul 15, 2020
b68ba49
Delete checkpoints
diwakar-vsingh Jul 15, 2020
e19b299
Update default.html
bethanystate Jul 15, 2020
6ab4c9d
updated
Jul 15, 2020
ce59b62
Merge branch 'master' of https://github.com/bethanystate/CS7641_project
Jul 15, 2020
f1a7c62
Update default.html
bethanystate Jul 15, 2020
416850e
updated
Jul 15, 2020
5254eb4
Merge branch 'master' of https://github.com/bethanystate/CS7641_project
Jul 15, 2020
41628b5
Update README_Saeed.md
rashidi1saeed Jul 15, 2020
9068180
Update README_Saeed.md
rashidi1saeed Jul 15, 2020
d88205e
Update README.md
rashidi1saeed Jul 15, 2020
2b994ff
Update README.md
rashidi1saeed Jul 15, 2020
0d0885e
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
d18895b
Update default.html
bethanystate Jul 15, 2020
ee8a211
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
e0ddc5b
Update README.md
bethanystate Jul 15, 2020
d92ad1c
Update README.md
bethanystate Jul 15, 2020
e41a8bd
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
6f02b6c
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
a41c2e8
Update default.html
bethanystate Jul 15, 2020
7ba7dd4
Update README.md
bethanystate Jul 15, 2020
357ae3a
Update default.html
bethanystate Jul 15, 2020
4211eb5
Update default.html
bethanystate Jul 15, 2020
1a7a810
Update default.html
bethanystate Jul 15, 2020
da1af4e
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
80f51f6
Add files via upload
bethanystate Jul 15, 2020
9b226bb
Update default.html
bethanystate Jul 15, 2020
cfaaf05
Update default.html
bethanystate Jul 15, 2020
0c16251
Figure 1
bethanystate Jul 15, 2020
d93a480
Add files via upload
bethanystate Jul 15, 2020
abca134
Create readme.md
bethanystate Jul 15, 2020
b4aaae2
Add files via upload
bethanystate Jul 15, 2020
9cacdf7
Delete exp1.png
bethanystate Jul 15, 2020
a071e36
Delete exp2.png
bethanystate Jul 15, 2020
5440f18
Delete exp3.png
bethanystate Jul 15, 2020
4c729f5
Create Figure 2
bethanystate Jul 15, 2020
e4e1b20
Delete Figure 2
bethanystate Jul 15, 2020
0540e19
Create read.md
bethanystate Jul 15, 2020
e4e3568
Add files via upload
bethanystate Jul 15, 2020
608e631
Create readme.md
bethanystate Jul 15, 2020
610860a
Add files via upload
bethanystate Jul 15, 2020
da0c52d
Create readme.md
bethanystate Jul 15, 2020
6b60130
Add files via upload
bethanystate Jul 15, 2020
29c5af5
Create readme.md
bethanystate Jul 15, 2020
98b4d58
Add files via upload
bethanystate Jul 15, 2020
9d0ba15
Create readme.md
bethanystate Jul 15, 2020
3d00aec
Add files via upload
bethanystate Jul 15, 2020
83a4a7e
Add files via upload
bethanystate Jul 15, 2020
26e6f38
Add files via upload
bethanystate Jul 15, 2020
bcceb03
Update default.html
bethanystate Jul 15, 2020
0387cd2
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
95a246a
Delete padding_type4_.jpg
bethanystate Jul 15, 2020
ed41a38
Add files via upload
bethanystate Jul 15, 2020
a30e08a
Update README.md
bethanystate Jul 15, 2020
80cf0dd
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
845fa33
Update README.md
bethanystate Jul 15, 2020
b0cbd37
Add files via upload
bethanystate Jul 15, 2020
c1d85e6
Delete padding_type4_.jpg
bethanystate Jul 15, 2020
cfefa85
Add files via upload
bethanystate Jul 15, 2020
712933a
Update README.md
bethanystate Jul 15, 2020
8c5d009
Update README.md
bethanystate Jul 15, 2020
fc43be9
Update README.md
bethanystate Jul 15, 2020
35d261c
Update README.md
bethanystate Jul 15, 2020
f09922e
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
69cab49
Update README.md
diwakar-vsingh Jul 15, 2020
c8564fd
Update README.md
diwakar-vsingh Jul 15, 2020
df23cb3
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
f4ae0dc
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
ebd7d87
Update README.md
diwakar-vsingh Jul 15, 2020
1f6e83a
Update README.md
diwakar-vsingh Jul 15, 2020
4df416e
Update README.md
diwakar-vsingh Jul 15, 2020
763494c
Update README.md
diwakar-vsingh Jul 15, 2020
ed252e7
Update README.md
diwakar-vsingh Jul 15, 2020
1fd3f7d
Update README.md
diwakar-vsingh Jul 15, 2020
3f0a140
Update README.md
diwakar-vsingh Jul 15, 2020
84e78d7
Update README.md
diwakar-vsingh Jul 15, 2020
4d7b0f9
Update README.md
diwakar-vsingh Jul 15, 2020
d4b018c
Update README.md
diwakar-vsingh Jul 15, 2020
68ad7a4
Update README.md
diwakar-vsingh Jul 15, 2020
2426e38
Update README.md
diwakar-vsingh Jul 15, 2020
b5b7f4f
Update README.md
diwakar-vsingh Jul 15, 2020
9cd4946
Update README.md
diwakar-vsingh Jul 15, 2020
43bd99b
Update README.md
diwakar-vsingh Jul 15, 2020
f5b973b
Update README.md
diwakar-vsingh Jul 15, 2020
953b104
Update README.md
diwakar-vsingh Jul 15, 2020
fb21123
Update README.md
rashidi1saeed Jul 15, 2020
899ed28
Update README.md
diwakar-vsingh Jul 15, 2020
a7ea2be
Update README.md
diwakar-vsingh Jul 15, 2020
5154a23
Update style.scss
bethanystate Jul 15, 2020
8296f3b
Update README.md
diwakar-vsingh Jul 15, 2020
a796874
Update README.md
diwakar-vsingh Jul 15, 2020
574d6b5
Update README.md
bethanystate Jul 15, 2020
5d93cd3
Update README.md
bethanystate Jul 15, 2020
fa13fd2
Update README.md
diwakar-vsingh Jul 15, 2020
695214c
Update README.md
bethanystate Jul 15, 2020
d300802
Update README.md
bethanystate Jul 15, 2020
311fe2e
Update README.md
diwakar-vsingh Jul 15, 2020
f3d9794
Update README.md
diwakar-vsingh Jul 15, 2020
d5fe292
Update README.md
diwakar-vsingh Jul 15, 2020
144051b
Update README.md
diwakar-vsingh Jul 15, 2020
0f3d6b3
Update README.md
diwakar-vsingh Jul 15, 2020
280a5f4
Update README.md
diwakar-vsingh Jul 15, 2020
61df0be
Delete padding_type5.jpg
diwakar-vsingh Jul 15, 2020
d41a244
Update README.md
diwakar-vsingh Jul 15, 2020
37ecb7a
Update README.md
diwakar-vsingh Jul 15, 2020
9001f94
Delete disc1.png
diwakar-vsingh Jul 15, 2020
47b570b
Delete disc2.png
diwakar-vsingh Jul 15, 2020
9f43c99
Delete disc3.png
diwakar-vsingh Jul 15, 2020
135d3ab
Delete gen.png
diwakar-vsingh Jul 15, 2020
49e6da8
Delete README.md
diwakar-vsingh Jul 15, 2020
0637fd0
Add files via upload
diwakar-vsingh Jul 15, 2020
d6c059d
Delete padding_type4_.jpg
diwakar-vsingh Jul 15, 2020
57836a4
Update README.md
dyan49 Jul 15, 2020
c8ac475
Delete README_Saeed.md
diwakar-vsingh Jul 15, 2020
b302fe2
Update README.md
dyan49 Jul 15, 2020
fb043d4
Add files via upload
diwakar-vsingh Jul 15, 2020
3c49df4
Update README.md
diwakar-vsingh Jul 15, 2020
81286dc
Add files via upload
diwakar-vsingh Jul 15, 2020
f43629b
Update style.scss
bethanystate Jul 15, 2020
7c755b0
Add files via upload
diwakar-vsingh Jul 15, 2020
eb5f2ae
Update README.md
diwakar-vsingh Jul 15, 2020
471fa52
Update README.md
diwakar-vsingh Jul 15, 2020
b547b91
Update README.md
bethanystate Jul 15, 2020
265e125
Update README.md
dyan49 Jul 15, 2020
fcb581a
Update README.md
diwakar-vsingh Jul 15, 2020
0915b21
Update README.md
bethanystate Jul 15, 2020
2443be6
Update style.scss
bethanystate Jul 15, 2020
114a249
Update README.md
diwakar-vsingh Jul 15, 2020
5dd8691
Update README.md
diwakar-vsingh Jul 15, 2020
e0b2976
Update README.md
dyan49 Jul 15, 2020
b1ab6c1
Update README.md
dyan49 Jul 15, 2020
92ff282
Update README.md
dyan49 Jul 15, 2020
487751c
Update README.md
diwakar-vsingh Jul 15, 2020
436cedd
Update README.md
diwakar-vsingh Jul 15, 2020
14f806c
Update style.scss
bethanystate Jul 15, 2020
064de09
Create readme
diwakar-vsingh Jul 15, 2020
c5cd7a4
Rename readme to readme.md
diwakar-vsingh Jul 15, 2020
d37a75c
Update readme.md
diwakar-vsingh Jul 15, 2020
6001b19
Update README.md
diwakar-vsingh Jul 15, 2020
6da7684
Update README.md
dyan49 Jul 15, 2020
07ba11d
Update README.md
dyan49 Jul 15, 2020
c6f0dec
Update README.md
dyan49 Jul 15, 2020
b6c5352
Update README.md
dyan49 Jul 15, 2020
331449c
Update _config.yml
diwakar-vsingh Jul 15, 2020
6ca3de9
Update README.md
dyan49 Jul 15, 2020
1eb0422
Update README.md
dyan49 Jul 15, 2020
d463626
Update README.md
dyan49 Jul 15, 2020
445a3d0
Update README.md
dyan49 Jul 15, 2020
ed7dd15
Update default.html
diwakar-vsingh Jul 15, 2020
56d485c
Update README.md
dyan49 Jul 15, 2020
6177e9b
Update README.md
dyan49 Jul 15, 2020
15418ad
Update README.md
dyan49 Jul 15, 2020
32ea331
Update README.md
diwakar-vsingh Jul 15, 2020
fe46c4e
Update README.md
rashidi1saeed Jul 15, 2020
3358857
Update README.md
diwakar-vsingh Jul 15, 2020
0a1b2f8
Update README.md
rashidi1saeed Jul 15, 2020
a5aceef
Update README.md
diwakar-vsingh Jul 15, 2020
9eeebc6
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
aed1678
Update README.md
rashidi1saeed Jul 15, 2020
b11a744
Update README.md
rashidi1saeed Jul 15, 2020
db917fb
Update README.md
rashidi1saeed Jul 15, 2020
248be39
Update README.md
rashidi1saeed Jul 15, 2020
5e3786e
Update README.md
rashidi1saeed Jul 15, 2020
e0cdc6e
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
1f1a7b2
Update README.md
rashidi1saeed Jul 15, 2020
9715a7f
Update jekyll-theme-leap-day.scss
bethanystate Jul 15, 2020
0997777
Update default.html
bethanystate Jul 16, 2020
2210207
Update jekyll-theme-leap-day.scss
bethanystate Jul 16, 2020
fe23dd6
Update README.md
bethanystate Jul 16, 2020
1ed51e4
Update style.scss
bethanystate Jul 16, 2020
959c3f8
Update README.md
diwakar-vsingh Jul 16, 2020
61c8580
Update README.md
bethanystate Jul 16, 2020
9df6011
Update README.md
diwakar-vsingh Jul 16, 2020
93d01ee
Update README.md
diwakar-vsingh Jul 16, 2020
87c301b
Update README.md
diwakar-vsingh Jul 16, 2020
0173c5f
Update README.md
diwakar-vsingh Jul 16, 2020
adb961b
Update README.md
diwakar-vsingh Jul 16, 2020
b538746
Update README.md
diwakar-vsingh Jul 16, 2020
140213e
Update README.md
diwakar-vsingh Jul 16, 2020
10a2b04
Update README.md
diwakar-vsingh Jul 16, 2020
962d639
Update README.md
diwakar-vsingh Jul 16, 2020
2be1cd1
Update README.md
diwakar-vsingh Jul 16, 2020
254bf4e
Update README.md
bethanystate Jul 16, 2020
f01d1fb
Update README.md
bethanystate Jul 16, 2020
54c25de
Update README.md
bethanystate Jul 16, 2020
dc635f9
Update style.scss
bethanystate Jul 16, 2020
e511ce8
Update README.md
bethanystate Jul 16, 2020
a92fbee
Update README.md
bethanystate Jul 16, 2020
a9948b3
Update README.md
bethanystate Jul 16, 2020
2b69a21
Update README.md
rashidi1saeed Jul 16, 2020
2bca496
Update README.md
rashidi1saeed Jul 16, 2020
d195576
Update jekyll-theme-leap-day.scss
bethanystate Jul 16, 2020
c14e9ea
Update default.html
bethanystate Jul 16, 2020
ecec7c7
Update README.md
diwakar-vsingh Jul 16, 2020
dbbfeb4
Update README.md
diwakar-vsingh Jul 16, 2020
feee5e3
Update README.md
diwakar-vsingh Jul 16, 2020
8e1fbed
Update README.md
diwakar-vsingh Jul 16, 2020
9745bbe
Update README.md
diwakar-vsingh Jul 16, 2020
6baf445
Update README.md
dyan49 Jul 16, 2020
6d28cb1
Add files via upload
diwakar-vsingh Jul 16, 2020
f353148
Delete Literature_comparison.png
diwakar-vsingh Jul 16, 2020
15232b8
Add files via upload
diwakar-vsingh Jul 16, 2020
192f6f4
Update jekyll-theme-leap-day.scss
bethanystate Jul 16, 2020
f2bca76
Update README.md
diwakar-vsingh Jul 16, 2020
204b571
Update README.md
diwakar-vsingh Jul 16, 2020
7bd5a33
Update README.md
bethanystate Jul 16, 2020
360bf57
Update README.md
rashidi1saeed Jul 16, 2020
0bcd310
Update README.md
diwakar-vsingh Jul 16, 2020
10e31af
Update README.md
diwakar-vsingh Jul 16, 2020
d3d70ff
Update README.md
diwakar-vsingh Jul 16, 2020
ef2ad74
Update README.md
diwakar-vsingh Jul 16, 2020
d18ad08
Update README.md
diwakar-vsingh Jul 16, 2020
fe61362
Update readme.md
diwakar-vsingh Jul 16, 2020
a7417ea
Update README.md
diwakar-vsingh Jul 16, 2020
f416dd3
Update README.md
diwakar-vsingh Jul 16, 2020
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
1,564 changes: 1,564 additions & 0 deletions Implementation/CycleGAN.ipynb

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions Implementation/Discriminator_Images.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import matplotlib.pyplot as plt
import os
import glob

INPUT_DIR = "Results/Discriminator"


def main():
folders = ["Input", "PixelGAN", "PatchGAN1", "PatchGAN2", "PatchGAN3"]

plt.figure(figsize=(20, 15))
type = 0
fsize = 35
for file in folders:
test_images = sorted(glob.glob(os.path.join(INPUT_DIR, file, '*.jpg')))
type += 1
counter = 0
for img_path in test_images[0:5]:
img = plt.imread(img_path)
idx = 5 * counter + type
plt.subplot(5, 5, idx)
plt.imshow(img)
if idx == 1:
plt.title("Input", fontsize=fsize)
elif idx == 2:
plt.title("1x1", fontsize=fsize)
elif idx == 3:
plt.title("16x16", fontsize=fsize)
elif idx == 4:
plt.title("70x70", fontsize=fsize)
elif idx == 5:
plt.title("256x256", fontsize=fsize)
plt.axis('off')
counter += 1
# plt.savefig(fname="Artistic_Style3.png", bbox_inches='tight')
plt.show()
print('Saved Images')


if __name__ == '__main__':
main()
102 changes: 102 additions & 0 deletions Implementation/Literature Comparison.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import matplotlib.pyplot as plt
import tensorflow as tf

INPUT_DIR = "Results/Literature Comparison/"


def preprocess_image(image_path):
image = plt.imread(image_path)

# resize to 286x286
Ht = tf.shape(image)[0]
Wt = tf.cast(tf.math.multiply(1.5, tf.cast(Ht, tf.float16)), tf.int32)
image = tf.image.resize(image, [Ht, Wt], method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)

return image


def main():

plt.figure(figsize=(45, 15))
fsize =45
img_path = INPUT_DIR

# Chicago
img = preprocess_image(img_path + "chicago.jpg")
plt.subplot(2, 5, 1)
plt.imshow(img)
plt.title("Input", fontsize=fsize)
plt.axis('off')

# Style Image
img = preprocess_image(img_path + "Starry_night.jpg")
plt.subplot(2, 5, 2)
plt.imshow(img)
plt.title("Starry Night", fontsize=fsize)
plt.axis('off')


# Gatys Starry
img = preprocess_image(img_path + "Gatys_Starry.jpg")
plt.subplot(2, 5, 3)
plt.imshow(img)
plt.title("Gatys et al.", fontsize=fsize)
plt.axis('off')


# Justin Starry
img = preprocess_image(img_path + "Justin_Starry.jpg")
plt.subplot(2, 5, 4)
plt.imshow(img)
plt.title("Johnson et al.", fontsize=fsize)
plt.axis('off')

# CycleGAN Starry
img = preprocess_image(img_path + "CycleGAN_Starry.jpg")
plt.subplot(2, 5, 5)
plt.imshow(img)
plt.title("CycleGAN", fontsize=fsize)
plt.axis('off')

# Chicago
img = preprocess_image(img_path + "chicago.jpg")
plt.subplot(2, 5, 6)
plt.imshow(img)
plt.title("Input", fontsize=fsize)
plt.axis('off')

# Style Image
img = preprocess_image(img_path + "Wave.jpg")
plt.subplot(2, 5, 7)
plt.imshow(img)
plt.title("Gatys et al.", fontsize=fsize)
plt.axis('off')

# Gatys Starry
img = preprocess_image(img_path + "Gatys_Wave.jpg")
plt.subplot(2, 5, 8)
plt.imshow(img)
plt.title("Gatys et al.", fontsize=fsize)
plt.axis('off')

# Justin Starry
img = preprocess_image(img_path + "Justin_Wave.jpg")
plt.subplot(2, 5, 9)
plt.imshow(img)
plt.title("Johnson et al.", fontsize=fsize)
plt.axis('off')

# CycleGAN Starry
img = preprocess_image(img_path + "CycleGAN_Wave.jpg")
plt.subplot(2, 5, 10)
plt.imshow(img)
plt.title("CycleGAN", fontsize=fsize)
plt.axis('off')

# plt.savefig(fname="Artistic_Style3.png", bbox_inches='tight')
plt.show()
print('Saved Images')


if __name__ == '__main__':
main()
63 changes: 63 additions & 0 deletions Implementation/evaluate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
def make_dataset(filepath, method):
raw_dataset = tf.data.TFRecordDataset(filepath)

image_feature_description = {
'image/height': tf.io.FixedLenFeature([], tf.int64),
'image/width': tf.io.FixedLenFeature([], tf.int64),
'image/format': tf.io.FixedLenFeature([], tf.string),
'image/encoded': tf.io.FixedLenFeature([], tf.string),
}

def preprocess_image(encoded_image):
image = tf.image.decode_jpeg(encoded_image, 3)

# resize to 286x286
# image = tf.image.random_crop(image, [tf.shape(image)[0], tf.shape(image)[0], tf.shape(image)[-1]])
image = tf.image.resize(image, [286, 286], method=method)

# random crop a 256x256 area
image = tf.image.random_crop(image, [256, 256, tf.shape(image)[-1]], seed=tf.random.set_seed(1))
image = tf.cast(image, tf.float32)

# normalize from 0-255 to -1 to +1
image = tf.divide(image, 127.5) - 1.0

return image

def parse_image_function(example_proto):
# Parse the input tf.Example proto using the dictionary above.
features = tf.io.parse_single_example(example_proto, image_feature_description)
encoded_image = features['image/encoded']
image = preprocess_image(encoded_image)
return image

parsed_image_dataset = raw_dataset.map(parse_image_function)
return parsed_image_dataset


def generate_images(model, test_input, name, save=False):
prediction = model(test_input)
plt.figure(figsize=(15, 15))

display_list = [test_input[0], prediction[0]]
title = ['Input Image', 'Predicted Image']

for i in range(2):
plt.subplot(1, 2, i + 1)
plt.title(title[i])
# getting the pixel values between [0, 1] to plot it.

img = display_list[i]
Ht = tf.shape(img)[0]
Wt = tf.cast(tf.math.multiply(1.25, tf.cast(Ht, tf.float16)), tf.int32)
c = tf.shape(img)[-1]
img = tf.image.resize(img, [Ht, Wt], method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
if i == 1:
img = tf.image.adjust_jpeg_quality(img, jpeg_quality=100)

plt.imshow(img * 0.5 + 0.5)
plt.axis('off')

if save:
plt.savefig(fname=name, bbox_inches='tight')
plt.show()
41 changes: 41 additions & 0 deletions Implementation/generate_figures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import matplotlib.pyplot as plt
import os
import glob

OUTPUT_DIR = "Results/"
INPUT_DIR = "Results/"

def main():
folders = ["Input", "MonetPaintings", "CezannePaintings", "Ukiyo_ePaintings", "VanGoghPaintings"]

plt.figure(figsize=(20, 31))
type = 0
fsize = 40
for file in folders:
test_images = sorted(glob.glob(os.path.join(INPUT_DIR, file, '*.jpg')))
type += 1
counter = 0
for img_path in test_images[20:30]:
img = plt.imread(img_path)
idx = 5*counter + type
plt.subplot(10, 5, idx)
plt.imshow(img)
if idx == 1:
plt.title("Input", fontsize=fsize)
elif idx == 2:
plt.title("Monet", fontsize=fsize)
elif idx == 3:
plt.title("Cezanne", fontsize=fsize)
elif idx == 4:
plt.title("Ukiyo-e", fontsize=fsize)
elif idx == 5:
plt.title("Van Gogh", fontsize=fsize)
plt.axis('off')
counter += 1
plt.savefig(fname="Artistic_Style3.png", bbox_inches='tight')
plt.show()
print('Saved Images')


if __name__ == '__main__':
main()
71 changes: 71 additions & 0 deletions Implementation/generate_real_pictures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import matplotlib.pyplot as plt
import os
import glob

INPUT_DIR = "Results/"

def main():
folders = ["MonetToLandscapeInput", "MonetToLandscape"]

# plt.figure(figsize=(13, 25))
# type = 0
# fsize = 30
# for file in folders:
# test_images = sorted(glob.glob(os.path.join(INPUT_DIR, file, '*.jpg')))
# type += 1
# counter = 0
# for img_path in test_images[:6]:
# img = plt.imread(img_path)
# idx = 2 * counter + type
# plt.subplot(6, 2, idx)
# plt.imshow(img)
# if idx == 1:
# plt.title("Input", fontsize=fsize)
# elif idx == 2:
# plt.title("Output", fontsize=fsize)
# plt.axis('off')
# counter += 1
#
# plt.savefig(fname="MonetToLandscape1.png", bbox_inches='tight')
# plt.show()
# print('Saved Images 1')
#
# plt.figure(figsize=(13, 25))
# type = 0
# for file in folders:
# test_images = sorted(glob.glob(os.path.join(INPUT_DIR, file, '*.jpg')))
# type += 1
# counter = 0
# for img_path in test_images[6:12]:
# img = plt.imread(img_path)
# idx = 2 * counter + type
# plt.subplot(6, 2, idx)
# plt.imshow(img)
# if idx == 1:
# plt.title("Input", fontsize=fsize)
# elif idx == 2:
# plt.title("Output", fontsize=fsize)
# plt.axis('off')
# counter += 1
#
# plt.savefig(fname="MonetToLandscape2.png", bbox_inches='tight')
# plt.show()
# print('Saved Images 2')

plt.figure(figsize=(27, 25))
counter = 0
folders = ["MonetToLandscape1.png", "MonetToLandscape2.png"]
for img_path in folders:
img = plt.imread(img_path)
counter += 1
plt.subplot(1, 2, counter)
plt.imshow(img)
plt.axis('off')

plt.savefig(fname="MonetToLandscape.png", bbox_inches='tight')
plt.show()
print('Saved Images')


if __name__ == '__main__':
main()
Loading