SUBHROJM commited on
Commit
52f816a
1 Parent(s): 6b13f29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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 = torch.load(model_path, map_location=torch.device('cpu'))
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):