Bence commited on
Commit
48b43dc
1 Parent(s): 463620b
Files changed (1) hide show
  1. app.py +20 -3
app.py CHANGED
@@ -1,4 +1,21 @@
1
- import streamlit as st
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ultralyticsplus import YOLO, render_result
2
 
3
+ # load model
4
+ model = YOLO('ultralyticsplus/yolov8s')
5
+
6
+ # set model parameters
7
+ model.overrides['conf'] = 0.25 # NMS confidence threshold
8
+ model.overrides['iou'] = 0.45 # NMS IoU threshold
9
+ model.overrides['agnostic_nms'] = False # NMS class-agnostic
10
+ model.overrides['max_det'] = 1000 # maximum number of detections per image
11
+
12
+ # set image
13
+ image = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
14
+
15
+ # perform inference
16
+ results = model.predict(image)
17
+
18
+ # observe results
19
+ print(results[0].boxes)
20
+ render = render_result(model=model, image=image, result=results[0])
21
+ render.show()