Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import cv2
|
|
|
3 |
#!pip install transformers
|
4 |
#from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
5 |
import torch
|
@@ -7,7 +8,7 @@ import torch
|
|
7 |
model_path = "best.pt"
|
8 |
#tokenizer = AutoTokenizer.from_pretrained(model)
|
9 |
#model = AutoModelForSequenceClassification.from_pretrained(model)
|
10 |
-
loaded_model =
|
11 |
# Define the Gradio Interface
|
12 |
import easyocr
|
13 |
def image_classifier(img):
|
|
|
1 |
import gradio as gr
|
2 |
import cv2
|
3 |
+
from ultralytics import YOLO
|
4 |
#!pip install transformers
|
5 |
#from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
6 |
import torch
|
|
|
8 |
model_path = "best.pt"
|
9 |
#tokenizer = AutoTokenizer.from_pretrained(model)
|
10 |
#model = AutoModelForSequenceClassification.from_pretrained(model)
|
11 |
+
loaded_model = YOLO(model_path)
|
12 |
# Define the Gradio Interface
|
13 |
import easyocr
|
14 |
def image_classifier(img):
|