Tsiemonsma commited on
Commit
4d4a44a
·
verified ·
1 Parent(s): e94d28c

Upload detect.py

Browse files
Files changed (1) hide show
  1. detect.py +10 -0
detect.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+
3
+ def load_model(model_path):
4
+ model = torch.hub.load('ultralytics/yolov5', 'custom', path=model_path)
5
+ return model
6
+
7
+ def detect(image, model):
8
+ results = model(image)
9
+ return results
10
+