Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,17 @@ import torch.nn as nn
|
|
3 |
from parseq.system import System
|
4 |
import yaml
|
5 |
import cv2
|
6 |
-
from parseq.augmentation import trans
|
7 |
from PIL import Image
|
8 |
from wpodnet.lib_detection import load_model_wpod, detect_lp
|
9 |
import numpy as np
|
10 |
import gradio as gr
|
|
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
13 |
|
14 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
15 |
|
|
|
3 |
from parseq.system import System
|
4 |
import yaml
|
5 |
import cv2
|
|
|
6 |
from PIL import Image
|
7 |
from wpodnet.lib_detection import load_model_wpod, detect_lp
|
8 |
import numpy as np
|
9 |
import gradio as gr
|
10 |
+
from torchvision import transforms as T
|
11 |
|
12 |
+
trans = T.Compose([
|
13 |
+
T.Resize((224, 224), T.InterpolationMode.BICUBIC),
|
14 |
+
T.ToTensor(),
|
15 |
+
T.Normalize(0.5, 0.5)
|
16 |
+
])
|
17 |
|
18 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
19 |
|