princeml commited on
Commit
614bc36
·
1 Parent(s): 872bcba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -19,11 +19,12 @@ model = YOLO("best.pt") # load a custom model
19
  def gradio_wrapper(img):
20
  global model
21
  #print(np.shape(img))
22
- results = model.predict(img) # predict on an image
23
- print(model.names.get(box.cls.item()))
24
 
25
- return cv2.putText(img, str(results[0]),(00, 185), cv2.FONT_HERSHEY_SIMPLEX, 1,
26
- (0, 0, 255), 2, cv2.LINE_AA, False)
 
27
 
28
  demo = gr.Interface(
29
  gradio_wrapper,
 
19
  def gradio_wrapper(img):
20
  global model
21
  #print(np.shape(img))
22
+ results = model.predict(img, save = True) # predict on an image
23
+ # print(model.names.get(box.cls.item()))
24
 
25
+ # return cv2.putText(img, str(results[0]),(00, 185), cv2.FONT_HERSHEY_SIMPLEX, 1,
26
+ # (0, 0, 255), 2, cv2.LINE_AA, False)
27
+ return results
28
 
29
  demo = gr.Interface(
30
  gradio_wrapper,