fcakyon keremberke commited on
Commit
2409e13
1 Parent(s): 36ba5a2

Update README.md (#2)

Browse files

- Update README.md (8c9e0aa439d336d5ec36b17ff8dcc7a5cd420e5f)


Co-authored-by: Kerem <keremberke@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +11 -8
README.md CHANGED
@@ -30,18 +30,19 @@ model-index:
30
  ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch', 'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush']
31
  ```
32
 
 
33
  ### How to use
34
 
35
- - Install `ultralytics` and `ultralyticsplus`:
36
 
37
  ```bash
38
- pip install -U ultralytics ultralyticsplus
39
  ```
40
 
41
  - Load model and perform prediction:
42
 
43
  ```python
44
- from ultralyticsplus import YOLO, render_predictions
45
 
46
  # load model
47
  model = YOLO('ultralyticsplus/yolov8s')
@@ -53,12 +54,14 @@ model.overrides['agnostic_nms'] = False # NMS class-agnostic
53
  model.overrides['max_det'] = 1000 # maximum number of detections per image
54
 
55
  # set image
56
- img = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
57
 
58
  # perform inference
59
- for result in model.predict(img, imgsz=640, return_outputs=True):
60
- print(result) # [x1, y1, x2, y2, conf, class]
61
- render = render_predictions(model, img=img, det=result["det"])
62
- render.show()
 
 
63
  ```
64
 
 
30
  ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch', 'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush']
31
  ```
32
 
33
+
34
  ### How to use
35
 
36
+ - Install [ultralyticsplus](https://github.com/fcakyon/ultralyticsplus):
37
 
38
  ```bash
39
+ pip install -U ultralyticsplus==0.0.14
40
  ```
41
 
42
  - Load model and perform prediction:
43
 
44
  ```python
45
+ from ultralyticsplus import YOLO, render_result
46
 
47
  # load model
48
  model = YOLO('ultralyticsplus/yolov8s')
 
54
  model.overrides['max_det'] = 1000 # maximum number of detections per image
55
 
56
  # set image
57
+ image = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
58
 
59
  # perform inference
60
+ results = model.predict(image)
61
+
62
+ # observe results
63
+ print(results[0].boxes)
64
+ render = render_result(model=model, image=image, result=results[0])
65
+ render.show()
66
  ```
67