interplane.Get Omega
Read in your language

ggml

[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)

Brought by drakestapleton

branch master Branches Tags History

ggml / examples / yolo / README.md

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