skytnt commited on
Commit
9542215
1 Parent(s): 0f3c87f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -112,11 +112,11 @@ class Model:
112
  self.anime_seg = rt.InferenceSession(anime_seg_path, providers=providers)
113
 
114
  def get_img(self, w, noise=0):
115
- img = self.g_synthesis.run(None, {'w': w, "noise": np.asarray([noise], dtype=np.float32)})[0]
116
  return (img.transpose(0, 2, 3, 1) * 127.5 + 128).clip(0, 255).astype(np.uint8)[0]
117
 
118
  def get_w(self, z, psi1, psi2):
119
- return self.g_mapping.run(None, {'z': z, 'psi': np.asarray([psi1, psi2], dtype=np.float32)})[0]
120
 
121
  def remove_bg(self, img, s=1024):
122
  img0 = img
 
112
  self.anime_seg = rt.InferenceSession(anime_seg_path, providers=providers)
113
 
114
  def get_img(self, w, noise=0):
115
+ img = self.g_synthesis.run(None, {'w': w.astype(np.float32), "noise": np.asarray([noise], dtype=np.float32)})[0]
116
  return (img.transpose(0, 2, 3, 1) * 127.5 + 128).clip(0, 255).astype(np.uint8)[0]
117
 
118
  def get_w(self, z, psi1, psi2):
119
+ return self.g_mapping.run(None, {'z': z.astype(np.float32), 'psi': np.asarray([psi1, psi2], dtype=np.float32)})[0]
120
 
121
  def remove_bg(self, img, s=1024):
122
  img0 = img