morinop commited on
Commit
7a5b6f5
1 Parent(s): a800e1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -2,6 +2,8 @@ import gradio as gr
2
  import requests
3
  import torch
4
  import torch.nn as nn
 
 
5
 
6
  import timm
7
 
@@ -23,6 +25,7 @@ def print_bn():
23
  def update_bn(image):
24
  cursor_im = 0
25
  image = image.reshape(-1)
 
26
  for m in model.modules():
27
  if(type(m) is nn.BatchNorm2d):
28
  if(cursor_im < image.shape[0]):
 
2
  import requests
3
  import torch
4
  import torch.nn as nn
5
+ import torchvision
6
+ import torchvision.transforms as T
7
 
8
  import timm
9
 
 
25
  def update_bn(image):
26
  cursor_im = 0
27
  image = image.reshape(-1)
28
+ image = T.Resize((40,40))(image)
29
  for m in model.modules():
30
  if(type(m) is nn.BatchNorm2d):
31
  if(cursor_im < image.shape[0]):