Doron Adler commited on
Commit
d4587fd
1 Parent(s): e042cd1

How will your face look after the Apocalypse? Will you become a Zombie? A Ghoul? A person who fights them? Upload an image with a face, or click one of the examples below. If a face could not be detected, A face will still be created based on the features of the input.

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -34,7 +34,8 @@ def find_aligned_face(image_in, size=256):
34
  def align_first_face(image_in, size=256):
35
  aligned_image, n_faces, quad = find_aligned_face(image_in,size=size)
36
  if n_faces == 0:
37
- return None
 
38
  else:
39
  im_array = image_as_array(aligned_image)
40
 
@@ -81,7 +82,7 @@ def inference(img):
81
 
82
 
83
  title = "Apocalyptify"
84
- description = "How will your face look after the Apocalypse? Upload an image with a face, or click one of the examples below. If a face could not be detected, the output box will remain empty."
85
  article = "<p style='text-align: center'><a href='https://github.com/justinpinkney/pixel2style2pixel/tree/nw' target='_blank'>Github Repo</a></p><p style='text-align: center'>samples: <img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00001.jpg' alt='Sample00001'/><img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00002.jpg' alt='Sample00002'/><img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00003.jpg' alt='Sample00003'/><img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00004.jpg' alt='Sample00004'/><img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00005.jpg' alt='Sample00005'/></p><p>The Apocalypse model was fine tuned on a pre-trained Pixel2Style2Pixel model by Doron Adler</p>"
86
 
87
  examples=[['Example00001.jpg'],['Example00002.jpg'],['Example00003.jpg'],['Example00004.jpg'],['Example00005.jpg'], ['Example00006.jpg']]
 
34
  def align_first_face(image_in, size=256):
35
  aligned_image, n_faces, quad = find_aligned_face(image_in,size=size)
36
  if n_faces == 0:
37
+ image_in = image_in.resize((size, size))
38
+ im_array = image_as_array(image_in)
39
  else:
40
  im_array = image_as_array(aligned_image)
41
 
 
82
 
83
 
84
  title = "Apocalyptify"
85
+ description = "How will your face look after the Apocalypse? Will you become a Zombie? A Ghoul? A person who fights them? Upload an image with a face, or click one of the examples below. If a face could not be detected, A face will still be created based on the features of the input."
86
  article = "<p style='text-align: center'><a href='https://github.com/justinpinkney/pixel2style2pixel/tree/nw' target='_blank'>Github Repo</a></p><p style='text-align: center'>samples: <img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00001.jpg' alt='Sample00001'/><img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00002.jpg' alt='Sample00002'/><img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00003.jpg' alt='Sample00003'/><img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00004.jpg' alt='Sample00004'/><img src='https://hf.space/gradioiframe/Norod78/Apocalyptify/file/Sample00005.jpg' alt='Sample00005'/></p><p>The Apocalypse model was fine tuned on a pre-trained Pixel2Style2Pixel model by Doron Adler</p>"
87
 
88
  examples=[['Example00001.jpg'],['Example00002.jpg'],['Example00003.jpg'],['Example00004.jpg'],['Example00005.jpg'], ['Example00006.jpg']]