Norod78 commited on
Commit
da7226b
·
verified ·
1 Parent(s): 73753c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import os
2
- os.system("pip install dlib==19.24.2")
3
 
4
  import sys
5
  import face_detection
@@ -12,7 +12,6 @@ torch.set_grad_enabled(False)
12
  net = torch.jit.load('dragness_p2s2p_torchscript_cpu.pt')
13
  net.eval()
14
 
15
-
16
  def tensor2im(var):
17
  var = var.cpu().detach().transpose(0, 2).transpose(0, 1).numpy()
18
  var = ((var + 1) / 2)
@@ -85,7 +84,7 @@ def inference(img):
85
  out = face2drag(img, 256)
86
  return out
87
 
88
-
89
  title = "Dragness"
90
  description = "Gradio demo for Drag finetuned Pixel2Style2Pixel. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
91
  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/Dragness/file/Sample00001.jpg' alt='Sample00001'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00002.jpg' alt='Sample00002'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00003.jpg' alt='Sample00003'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00004.jpg' alt='Sample00004'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00005.jpg' alt='Sample00005'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00006.jpg' alt='Sample00006'/></p><p>Drag model was fine tuned by Doron Adler</p>"
 
1
  import os
2
+ os.system("pip install dlib")
3
 
4
  import sys
5
  import face_detection
 
12
  net = torch.jit.load('dragness_p2s2p_torchscript_cpu.pt')
13
  net.eval()
14
 
 
15
  def tensor2im(var):
16
  var = var.cpu().detach().transpose(0, 2).transpose(0, 1).numpy()
17
  var = ((var + 1) / 2)
 
84
  out = face2drag(img, 256)
85
  return out
86
 
87
+
88
  title = "Dragness"
89
  description = "Gradio demo for Drag finetuned Pixel2Style2Pixel. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
90
  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/Dragness/file/Sample00001.jpg' alt='Sample00001'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00002.jpg' alt='Sample00002'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00003.jpg' alt='Sample00003'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00004.jpg' alt='Sample00004'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00005.jpg' alt='Sample00005'/><img src='https://hf.space/gradioiframe/Norod78/Dragness/file/Sample00006.jpg' alt='Sample00006'/></p><p>Drag model was fine tuned by Doron Adler</p>"