tarasevicius commited on
Commit
e4777e1
·
1 Parent(s): 736ef53

feat: switch to latest model

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. latest.pt → local_latest.pt +2 -2
app.py CHANGED
@@ -2,15 +2,14 @@ import gradio as gr
2
  import torch
3
  from PIL import Image
4
  import numpy as np
5
- from huggingface_hub import hf_hub_download
6
 
7
  import cv2
8
 
9
  # Download the model from Hugging Face Hub
10
- model_path = hf_hub_download(repo_id='ethandavey/yoloV5-coursework-model', filename='model.pt')
11
 
12
  # Load the YOLOv5 model
13
- model = torch.hub.load('ultralytics/yolov5', 'custom', path=model_path, source='github')
14
  model.line_thickness = 3 # Set the thickness of the bounding box lines
15
 
16
  # Print model class names
 
2
  import torch
3
  from PIL import Image
4
  import numpy as np
 
5
 
6
  import cv2
7
 
8
  # Download the model from Hugging Face Hub
9
+ model_path = 'local_latest.pt'
10
 
11
  # Load the YOLOv5 model
12
+ model = torch.hub.load('ultralytics/yolov5', 'custom', path=model_path, source='local')
13
  model.line_thickness = 3 # Set the thickness of the bounding box lines
14
 
15
  # Print model class names
latest.pt → local_latest.pt RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a02b20ec782cc8e78cd37c1b1126505d6537c9017d62e2b81ca468920c2efd21
3
- size 14346792
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56ffacbde772706c45eef26d0cd72b21f3d28e5e383c8d0945bd0ac283fc8b6d
3
+ size 14346728