ggml
[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)
Brought by drakestapleton
ggml / examples / yolo / README.md
| 1 | This example shows how to implement YOLO object detection with ggml using pretrained model. |
| 2 | |
| 3 | # YOLOv3-tiny |
| 4 | |
| 5 | Download the model weights: |
| 6 | |
| 7 | ```bash |
| 8 | $ wget https://pjreddie.com/media/files/yolov3-tiny.weights |
| 9 | $ sha1sum yolov3-tiny.weights |
| 10 | 40f3c11883bef62fd850213bc14266632ed4414f yolov3-tiny.weights |
| 11 | ``` |
| 12 | |
| 13 | Convert the weights to GGUF format: |
| 14 | |
| 15 | ```bash |
| 16 | $ ./convert-yolov3-tiny.py yolov3-tiny.weights |
| 17 | yolov3-tiny.weights converted to yolov3-tiny.gguf |
| 18 | ``` |
| 19 | |
| 20 | Alternatively, you can download the converted model from [HuggingFace](https://huggingface.co/rgerganov/yolo-gguf/resolve/main/yolov3-tiny.gguf) |
| 21 | |
| 22 | Object detection: |
| 23 | |
| 24 | ```bash |
| 25 | $ wget https://raw.githubusercontent.com/pjreddie/darknet/master/data/dog.jpg |
| 26 | $ ./yolov3-tiny -m yolov3-tiny.gguf -i dog.jpg |
| 27 | load_model: using CUDA backend |
| 28 | ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no |
| 29 | ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no |
| 30 | ggml_cuda_init: found 1 CUDA devices: |
| 31 | Device 0: NVIDIA T1200 Laptop GPU, compute capability 7.5, VMM: yes |
| 32 | Layer 0 output shape: 416 x 416 x 16 x 1 |
| 33 | Layer 1 output shape: 208 x 208 x 16 x 1 |
| 34 | Layer 2 output shape: 208 x 208 x 32 x 1 |
| 35 | Layer 3 output shape: 104 x 104 x 32 x 1 |
| 36 | Layer 4 output shape: 104 x 104 x 64 x 1 |
| 37 | Layer 5 output shape: 52 x 52 x 64 x 1 |
| 38 | Layer 6 output shape: 52 x 52 x 128 x 1 |
| 39 | Layer 7 output shape: 26 x 26 x 128 x 1 |
| 40 | Layer 8 output shape: 26 x 26 x 256 x 1 |
| 41 | Layer 9 output shape: 13 x 13 x 256 x 1 |
| 42 | Layer 10 output shape: 13 x 13 x 512 x 1 |
| 43 | Layer 11 output shape: 13 x 13 x 512 x 1 |
| 44 | Layer 12 output shape: 13 x 13 x 1024 x 1 |
| 45 | Layer 13 output shape: 13 x 13 x 256 x 1 |
| 46 | Layer 14 output shape: 13 x 13 x 512 x 1 |
| 47 | Layer 15 output shape: 13 x 13 x 255 x 1 |
| 48 | Layer 18 output shape: 13 x 13 x 128 x 1 |
| 49 | Layer 19 output shape: 26 x 26 x 128 x 1 |
| 50 | Layer 20 output shape: 26 x 26 x 384 x 1 |
| 51 | Layer 21 output shape: 26 x 26 x 256 x 1 |
| 52 | Layer 22 output shape: 26 x 26 x 255 x 1 |
| 53 | dog: 57% |
| 54 | car: 52% |
| 55 | truck: 56% |
| 56 | car: 62% |
| 57 | bicycle: 59% |
| 58 | Detected objects saved in 'predictions.jpg' (time: 0.057000 sec.) |
| 59 | ``` |