lime-j commited on
Commit
41fc385
·
1 Parent(s): 1ffc7c5
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -16,11 +16,9 @@ net_c.load_state_dict(torch.load('./classifier_32.pt')['icnn'])
16
  net_i.eval()
17
  net_c.eval()
18
  def align(x1):
19
- x2 = x1
20
- h, w = x1.height, x1.width
21
  h, w = h // 32 * 32, w // 32 * 32
22
- x1 = x1.resize((w, h))
23
- x2 = x2.resize((w, h))
24
  return x1
25
  def predict(img):
26
  with torch.no_grad():
 
16
  net_i.eval()
17
  net_c.eval()
18
  def align(x1):
19
+ h, w = x1.shape[:2]
 
20
  h, w = h // 32 * 32, w // 32 * 32
21
+ x1 = np.resize(x1, (h, w, x1.shape[2]))
 
22
  return x1
23
  def predict(img):
24
  with torch.no_grad():