Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
-
import torch
|
3 |
-
from PIL import Image
|
4 |
-
import torchvision.transforms as T
|
5 |
from ultralytics import YOLO
|
6 |
import cv2
|
7 |
import numpy as np
|
8 |
|
9 |
# Load the PT model
|
10 |
model = YOLO("Model_IV.pt")
|
11 |
-
# checkpoint = torch.load("Model_IV.pt")
|
12 |
-
|
13 |
-
# # Define preprocessing
|
14 |
-
# transform = T.Compose([
|
15 |
-
# T.Resize((224, 224)), # Adjust to your model's input size
|
16 |
-
# T.ToTensor(),
|
17 |
-
# ])
|
18 |
|
19 |
def predict(image):
|
20 |
# Preprocessing: Convert the colour space to RGB
|
|
|
1 |
import gradio as gr
|
2 |
+
# import torch
|
3 |
+
# from PIL import Image
|
4 |
+
# import torchvision.transforms as T
|
5 |
from ultralytics import YOLO
|
6 |
import cv2
|
7 |
import numpy as np
|
8 |
|
9 |
# Load the PT model
|
10 |
model = YOLO("Model_IV.pt")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
def predict(image):
|
13 |
# Preprocessing: Convert the colour space to RGB
|