thejagstudio
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,57 @@
|
|
1 |
-
---
|
2 |
-
license:
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: gpl-3.0
|
3 |
+
inference: false
|
4 |
+
tags:
|
5 |
+
- instance-segmentation
|
6 |
+
- computer-vision
|
7 |
+
- vision
|
8 |
+
- yolo
|
9 |
+
- yolov8
|
10 |
+
datasets:
|
11 |
+
- detection-datasets/coco
|
12 |
+
---
|
13 |
+
### How to use
|
14 |
+
|
15 |
+
- Install yolov8:
|
16 |
+
|
17 |
+
```bash
|
18 |
+
pip install -U yolov8
|
19 |
+
```
|
20 |
+
|
21 |
+
- Load model and perform prediction:
|
22 |
+
|
23 |
+
```python
|
24 |
+
import yolov5
|
25 |
+
# load model
|
26 |
+
model = yolov5.load('fcakyon/yolov5n-v7.0')
|
27 |
+
|
28 |
+
# set model parameters
|
29 |
+
model.conf = 0.25 # NMS confidence threshold
|
30 |
+
model.iou = 0.45 # NMS IoU threshold
|
31 |
+
model.agnostic = False # NMS class-agnostic
|
32 |
+
model.multi_label = False # NMS multiple labels per box
|
33 |
+
model.max_det = 1000 # maximum number of detections per image
|
34 |
+
# set image
|
35 |
+
img = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
|
36 |
+
# perform inference
|
37 |
+
results = model(img)
|
38 |
+
# inference with larger input size
|
39 |
+
results = model(img, size=640)
|
40 |
+
# inference with test time augmentation
|
41 |
+
results = model(img, augment=True)
|
42 |
+
# parse results
|
43 |
+
predictions = results.pred[0]
|
44 |
+
boxes = predictions[:, :4] # x1, y1, x2, y2
|
45 |
+
scores = predictions[:, 4]
|
46 |
+
categories = predictions[:, 5]
|
47 |
+
# show detection bounding boxes on image
|
48 |
+
results.show()
|
49 |
+
# save results into "results/" folder
|
50 |
+
results.save(save_dir='results/')
|
51 |
+
```
|
52 |
+
|
53 |
+
- Finetune the model on your custom dataset:
|
54 |
+
|
55 |
+
```bash
|
56 |
+
yolov5 train --img 640 --batch 16 --weights fcakyon/yolov5n-v7.0 --epochs 10 --device cuda:0
|
57 |
+
```
|