Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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]):
|