Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
import torch
|
|
|
|
|
|
|
| 4 |
import torchvision.models as models
|
| 5 |
import torchvision.transforms as transforms
|
| 6 |
import cv2
|
|
@@ -9,7 +11,7 @@ import openpyxl
|
|
| 9 |
import os
|
| 10 |
|
| 11 |
# Load the pre-trained EfficientNet-B7 model
|
| 12 |
-
model = torchvision.models.efficientnet_b7(
|
| 13 |
model.eval()
|
| 14 |
|
| 15 |
# Define the transformations to be applied to the input image
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
import torch
|
| 4 |
+
import torchvision
|
| 5 |
+
from torchvision.models import EfficientNet_B7_Weights
|
| 6 |
import torchvision.models as models
|
| 7 |
import torchvision.transforms as transforms
|
| 8 |
import cv2
|
|
|
|
| 11 |
import os
|
| 12 |
|
| 13 |
# Load the pre-trained EfficientNet-B7 model
|
| 14 |
+
model = torchvision.models.efficientnet_b7(weights=EfficientNet_B7_Weights.DEFAULT)
|
| 15 |
model.eval()
|
| 16 |
|
| 17 |
# Define the transformations to be applied to the input image
|