niobures commited on
Commit
231f284
·
verified ·
1 Parent(s): 2098ea8

WALDO (code, models)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ models/waldo30/WALDO30_yolov8m_640x640_confusion_matrix_normalized.png filter=lfs diff=lfs merge=lfs -text
37
+ models/waldo30/WALDO30_yolov8m_640x640_F1_curve.png filter=lfs diff=lfs merge=lfs -text
38
+ models/waldo30/WALDO30_yolov8n_416x416_confusion_matrix_normalized.png filter=lfs diff=lfs merge=lfs -text
39
+ models/waldo30/WALDO30_yolov8n_416x416_F1_curve.pngF1_curve.png filter=lfs diff=lfs merge=lfs -text
40
+ models/waldo30/WALDO30_yolov8n_640x640_confusion_matrix_normalized_F1_curve.png filter=lfs diff=lfs merge=lfs -text
41
+ models/waldo30/WALDO30_yolov8n_640x640_confusion_matrix_normalized.png filter=lfs diff=lfs merge=lfs -text
code/WALDO.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e67e13a15d9d7c735afdf5fe69daffc3b7159390aa81dddfe1403551fc4704d
3
+ size 169975955
models/waldo30-onnx/.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
models/waldo30-onnx/config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "yolos",
3
+ "id2label": {
4
+ "0": "LightVehicle",
5
+ "1": "Person",
6
+ "2": "Building",
7
+ "3": "UPole",
8
+ "4": "Boat",
9
+ "5": "Bike",
10
+ "6": "Container",
11
+ "7": "Truck",
12
+ "8": "Gastank",
13
+ "9": "Digger",
14
+ "10": "SolarPanels",
15
+ "11": "Bus"
16
+ },
17
+ "label2id": {
18
+ "LightVehicle": 0,
19
+ "Person": 1,
20
+ "Building": 2,
21
+ "UPole": 3,
22
+ "Boat": 4,
23
+ "Bike": 5,
24
+ "Container": 6,
25
+ "Truck": 7,
26
+ "Gastank": 8,
27
+ "Digger": 9,
28
+ "SolarPanels": 10,
29
+ "Bus": 11
30
+ }
31
+ }
models/waldo30-onnx/onnx/model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be80223d0d59f36baffb9542b52b087dee3712c8e8d120b65453576b69796c27
3
+ size 103632215
models/waldo30-onnx/preprocessor_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": false,
3
+ "do_pad": false,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "feature_extractor_type": "ImageFeatureExtractor",
7
+ "resample": 2,
8
+ "rescale_factor": 0.00392156862745098,
9
+ "size": {
10
+ "width": 640,
11
+ "height": 640
12
+ }
13
+ }
models/waldo30-onnx/source.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ https://huggingface.co/mhassanch/waldo30-onnx
models/waldo30-yolov8m-640x640/.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
models/waldo30-yolov8m-640x640/README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - StephanST/WALDO30
4
+ tags:
5
+ - onnx
6
+ - yolov8
7
+ - transformer.js
8
+ - '@geobase-js/geoai'
9
+ ---
10
+ This ONNX model is a converted version of the original model available at: [StephanST/WALDO30](https://huggingface.co/StephanST/WALDO30).
models/waldo30-yolov8m-640x640/config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "yolos",
3
+ "id2label": {
4
+ "0": "LightVehicle",
5
+ "1": "Person",
6
+ "2": "Building",
7
+ "3": "UPole",
8
+ "4": "Boat",
9
+ "5": "Bike",
10
+ "6": "Container",
11
+ "7": "Truck",
12
+ "8": "Gastank",
13
+ "9": "Digger",
14
+ "10": "SolarPanels",
15
+ "11": "Bus"
16
+ },
17
+ "label2id": {
18
+ "LightVehicle": 0,
19
+ "Person": 1,
20
+ "Building": 2,
21
+ "UPole": 3,
22
+ "Boat": 4,
23
+ "Bike": 5,
24
+ "Container": 6,
25
+ "Truck": 7,
26
+ "Gastank": 8,
27
+ "Digger": 9,
28
+ "SolarPanels": 10,
29
+ "Bus": 11
30
+ }
31
+ }
models/waldo30-yolov8m-640x640/onnx/model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46df6260eb4a7ef47e5f625985bd5f4f0616b13020f26ca55932171c0c44f074
3
+ size 103632215
models/waldo30-yolov8m-640x640/onnx/model_quantized.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46df6260eb4a7ef47e5f625985bd5f4f0616b13020f26ca55932171c0c44f074
3
+ size 103632215
models/waldo30-yolov8m-640x640/preprocessor_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": false,
3
+ "do_pad": false,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "feature_extractor_type": "ImageFeatureExtractor",
7
+ "resample": 2,
8
+ "rescale_factor": 0.00392156862745098,
9
+ "size": {
10
+ "width": 640,
11
+ "height": 640
12
+ }
13
+ }
models/waldo30/.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
models/waldo30/README.md ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ base_model:
5
+ - Ultralytics/YOLOv8
6
+ pipeline_tag: object-detection
7
+ ---
8
+
9
+ W.A.L.D.O.
10
+ Whereabouts Ascertainment for Low-lying Detectable Objects
11
+ ---------------------------------------------------------------------
12
+
13
+
14
+ [![WALDO 3.0 preview vid](https://i.imgur.com/hGghrLn.jpeg)](https://www.youtube.com/watch?v=1y5y9yklj2U)
15
+
16
+ Welcome to the WALDO v3.0 public release
17
+ ---------------------------------------------------------------------
18
+
19
+
20
+ WHAT IS WALDO?
21
+
22
+ WALDO is a detection AI model, based on a large YOLO-v8 backbone and my own
23
+ synthetic data pipeline. **The model is capable of detecting these classes
24
+ of items in overhead imagery ranging in altitude from about 30 feet to
25
+ satellite imagery!**
26
+
27
+
28
+ Output classes:
29
+
30
+ 0 -> 'LightVehicle' --> all kinds of civilan cars, including pickup trucks, vans etc... 🚗🏎️🚓🚐🚑 </br>
31
+ 1 -> 'Person' --> people! all kinds of people including ones that are on bikes or swimming in the sea 🧍‍♀️🕺💃🧜🏽‍♀️🏂🧞</br>
32
+ 2 -> 'Building' --> all kinds of buildings 🕌🏛️🏭🏡</br>
33
+ 3 -> 'UPole' --> utility poles, power poles, anything thin and sticking up that you should avoid with a drone 🎏</br>
34
+ 4 -> 'Boat' --> boats, ships, canoes, kayaks, surf boards... all the floaty stuff 🚢🏄</br>
35
+ 5 -> 'Bike' --> bikes, mopeds, motorbikes, all stuff with 2 wheels 🚲</br>
36
+ 6 -> 'Container' --> shipping containers, including on the back of an articulated truck... 📦🏗️</br>
37
+ 7 -> 'Truck' --> large commercial vehicles including articulated trucks or big box-on-chassis delivery trucks 🚚</br>
38
+ 8 -> 'Gastank'--> cylindrical tanks such as butane tanks and gas expansion tanks, or grain silos... pretty much anything that looks cylindrical for storing liquids 🫙</br>
39
+ 10 -> 'Digger' --> all kinds of construction vehicles, including tractors and construction gear 🚜</br>
40
+ 11 -> 'Solarpanels' --> solar panels ▪️🌞▪️</br>
41
+ 12 -> 'Bus' --> a bus 🚌</br>
42
+
43
+ --> In general the lower the class number the better-trained you can expect it to be.
44
+ For users of previous versions of WALDO: note that I removed the military class and smoke detection. This is meant to be a FOSS tool for civilian use and I don't want to pursue making it work for military applications.
45
+
46
+
47
+ ---------------------------------------------------------------------
48
+
49
+ WHERE IS WALDO?
50
+
51
+ Right here on HF!
52
+
53
+ Note there are a couple more models that have slightly better performance over on Gumroad here: https://6228189440665.gumroad.com/l/WALDOv3
54
+ Those are for sale as a kind of sponsorship for the project: if you find value in the free ones here you can buy those for a nice little performance boost... but it's entirey up to you!
55
+
56
+
57
+ [![P2 model performance boost](https://i.imgur.com/VKa5NN5.png)]
58
+
59
+
60
+ In both cases the actual files are MIT license and you can freely share them, so if someone gives you the ones from Gumroad you are free yo use them including commercially. It's really just a way to offset some of the work and compute that went into making this project and keeping it FOSS.
61
+
62
+
63
+ ---------------------------------------------------------------------
64
+
65
+ WHAT IS IT GOOD FOR?
66
+
67
+ People are currently using versions of WALDO for:
68
+ 1. disaster recovery
69
+ 2. monitoring wildlife sanctuaries (intruder detection)
70
+ 3. occupancy calculation (parking lots etc..)
71
+ 4. monitoring infrastructure
72
+ 5. construction site monitoring
73
+ 6. traffic flow management
74
+ 7. crowd counting
75
+ 8. some fun AI art applications!
76
+ 9. drone safety (avoiding people / cars on the ground)
77
+ 10. lots of other fun stuff...
78
+
79
+ The main reason for me to make WALDO free has in fact been discovering all these cool applications. Let me know what you build!
80
+
81
+ ---------------------------------------------------------------------
82
+
83
+ FOR AI NERDS !
84
+
85
+ It's a set of YOLOv8 model, trained on my own datasets of synthetic and "augmented" / semi-synthetic data.
86
+ I'm not going to release the dataset for the time being.
87
+
88
+ The weights are completely open, allowing you to deploy in any number of ways this time!
89
+
90
+
91
+ ---------------------------------------------------------------------
92
+
93
+ HOW CAN I START WITH WALDO?
94
+
95
+ Check out the boilerplate code in the repo to run the models and output pretty detections using the wonderful Supervision annotation library from Roboflow :)
96
+
97
+ ---------------------------------------------------------------------
98
+
99
+ GOING DEEPER
100
+
101
+ Of course if you know your way around deploying AI models there is a lot more you do
102
+ with this release, inclusing:
103
+
104
+ 1. fine-tuning the models on your own data (if you know what you are doing, this is probably your starting point)
105
+ 2. building a nicely optimized sliding-window inference setup that works nicely on your edge hardware
106
+ 3. quantizing the models for super-duper edge performance on cheap devices
107
+ 4. using the models to annotate your own data and train something of your own!
108
+
109
+
110
+ Enjoy!
111
+
112
+ ---------------------------------------------------------------------
113
+
114
+
115
+ PREVIOUS VERSIONS
116
+
117
+ I am retiring the old versions, this is the only one that will stay online.
118
+
119
+ ---------------------------------------------------------------------
120
+
121
+
122
+ CAN YOU HELP ME WITH X?
123
+
124
+ Sure, email me at stephan.sturges@gmail.com
125
+
126
+
127
+ ---------------------------------------------------------------------
128
+
129
+
130
+ DETECTION OF X ISN'T WORKING AS EXPECTED:
131
+
132
+ I'd love to see example images, videos, sample data, etc at:
133
+ stephan.sturges@gmail.com
134
+
135
+
136
+ ---------------------------------------------------------------------
137
+
138
+ SUPPORT WALDO!
139
+
140
+ Visit [![the WALDO gumroad page](https://t.co/kRvhYkVxW2)] to support the project!
141
+
142
+ ---------------------------------------------------------------------
143
+
144
+
145
+ LICENSE
146
+ ----------------------------------------------------------------------------
147
+
148
+ Unless otherwise specified all code in this release is published with the
149
+ licence conditions below.
150
+ ----------------------------------------------------------------------------
151
+
152
+
153
+ MIT License
154
+
155
+ Copyright (c) 2024 Stephan Sturges / Aircortex.com
156
+
157
+ Permission is hereby granted, free of charge, to any person obtaining a copy
158
+ of this software and associated documentation files (the "Software"), to deal
159
+ in the Software without restriction, including without limitation the rights
160
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
161
+ copies of the Software, and to permit persons to whom the Software is
162
+ furnished to do so, subject to the following conditions:
163
+
164
+ The above copyright notice and this permission notice shall be included in all
165
+ copies or substantial portions of the Software.
166
+
167
+ The software cannot be used for the 2025 SPRIND "fully autonomous flight 2.0" competition.
168
+
169
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
170
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
171
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
172
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
173
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
174
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
175
+ SOFTWARE.
models/waldo30/WALDO30_yolov8m_640x640.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f1ee3daa755f68ffe1eea7a51ab6074614bb38df2097587317548b0395064da
3
+ size 52075265
models/waldo30/WALDO30_yolov8m_640x640_F1_curve.png ADDED

Git LFS Details

  • SHA256: f0968913ff2c9ceea7780b2442afe9e2feca9695974303baeafe5d8a539eb176
  • Pointer size: 131 Bytes
  • Size of remote file: 440 kB
models/waldo30/WALDO30_yolov8m_640x640_confusion_matrix_normalized.png ADDED

Git LFS Details

  • SHA256: 6134cc3f604b927c533c292dff5424985a23674ba7ada98e4f817bf2bbfc2397
  • Pointer size: 131 Bytes
  • Size of remote file: 251 kB
models/waldo30/WALDO30_yolov8n_416x416.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae339e0dfff2c2e9652244e341ae7117bbae2d66d1f7c39c15fce64f25802fd1
3
+ size 6254489
models/waldo30/WALDO30_yolov8n_416x416_F1_curve.pngF1_curve.png ADDED

Git LFS Details

  • SHA256: 5cfab490d5b5137263ec4d72d7b4ec1f7dda96566180bf375f574fbde9d05bc4
  • Pointer size: 131 Bytes
  • Size of remote file: 389 kB
models/waldo30/WALDO30_yolov8n_416x416_confusion_matrix_normalized.png ADDED

Git LFS Details

  • SHA256: 04eb2326c50b8dbf6b86ad742cbd1c66bfed1497b1bdf65e28f1818a05b018e0
  • Pointer size: 131 Bytes
  • Size of remote file: 246 kB
models/waldo30/WALDO30_yolov8n_640x640.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:580cd0ee6e120808b5848ca9349717e280a0124ad5365cebee74c8fbd8c1881b
3
+ size 6285145
models/waldo30/WALDO30_yolov8n_640x640_confusion_matrix_normalized.png ADDED

Git LFS Details

  • SHA256: 6245d76d772e1315f158b6f825e3e2439bd0b21a57816759f5631f7684cda4b7
  • Pointer size: 131 Bytes
  • Size of remote file: 258 kB
models/waldo30/WALDO30_yolov8n_640x640_confusion_matrix_normalized_F1_curve.png ADDED

Git LFS Details

  • SHA256: ac843704ab6f7db51a1d1b4eb2195703fe269bd534d6641f422cfde5cb268702
  • Pointer size: 131 Bytes
  • Size of remote file: 431 kB
models/waldo30/run_sliced_inference.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import cv2
2
+ import sys
3
+ from sahi.models.yolov8 import Yolov8DetectionModel
4
+ from sahi.predict import get_sliced_prediction
5
+ import supervision as sv
6
+ import numpy as np
7
+
8
+ # Check the number of command-line arguments
9
+ if len(sys.argv) != 8:
10
+ print("Usage: python yolov8_video_inference.py <model_path> <input_video_path> <output_video_path> <slice_height> <slice_width> <overlap_height_ratio> <overlap_width_ratio>")
11
+ sys.exit(1)
12
+
13
+ # Get command-line arguments
14
+ model_path = sys.argv[1]
15
+ input_video_path = sys.argv[2]
16
+ output_video_path = sys.argv[3]
17
+ slice_height = int(sys.argv[4])
18
+ slice_width = int(sys.argv[5])
19
+ overlap_height_ratio = float(sys.argv[6])
20
+ overlap_width_ratio = float(sys.argv[7])
21
+
22
+ # Load YOLOv8 model with SAHI
23
+ detection_model = Yolov8DetectionModel(
24
+ model_path=model_path,
25
+ confidence_threshold=0.1,
26
+ device="cuda" # or "cpu"
27
+ )
28
+
29
+ # Open input video
30
+ cap = cv2.VideoCapture(input_video_path)
31
+ width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
32
+ height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
33
+ fps = cap.get(cv2.CAP_PROP_FPS)
34
+ fourcc = cv2.VideoWriter_fourcc(*"mp4v")
35
+
36
+ # Set up output video writer
37
+ out = cv2.VideoWriter(output_video_path, fourcc, fps, (width, height))
38
+
39
+ # Create bounding box and label annotators
40
+ #box_annotator = sv.BoundingBoxAnnotator(thickness=1)
41
+ box_annotator = sv.BoxCornerAnnotator(thickness=2)
42
+ label_annotator = sv.LabelAnnotator(text_scale=0.5, text_thickness=2)
43
+
44
+ # Process each frame
45
+ frame_count = 0
46
+ while cap.isOpened():
47
+ ret, frame = cap.read()
48
+ if not ret:
49
+ break
50
+
51
+ # Perform sliced inference on the current frame using SAHI
52
+ result = get_sliced_prediction(
53
+ image=frame,
54
+ detection_model=detection_model,
55
+ slice_height=slice_height,
56
+ slice_width=slice_width,
57
+ overlap_height_ratio=overlap_height_ratio,
58
+ overlap_width_ratio=overlap_width_ratio
59
+ )
60
+
61
+ # Extract data from SAHI result
62
+ object_predictions = result.object_prediction_list
63
+
64
+ # Initialize lists to hold the data
65
+ xyxy = []
66
+ confidences = []
67
+ class_ids = []
68
+ class_names = []
69
+
70
+ # Loop over the object predictions and extract data
71
+ for pred in object_predictions:
72
+ bbox = pred.bbox.to_xyxy() # Convert bbox to [x1, y1, x2, y2]
73
+ xyxy.append(bbox)
74
+ confidences.append(pred.score.value)
75
+ class_ids.append(pred.category.id)
76
+ class_names.append(pred.category.name)
77
+
78
+ # Check if there are any detections
79
+ if xyxy:
80
+ # Convert lists to numpy arrays
81
+ xyxy = np.array(xyxy, dtype=np.float32)
82
+ confidences = np.array(confidences, dtype=np.float32)
83
+ class_ids = np.array(class_ids, dtype=int)
84
+
85
+ # Create sv.Detections object
86
+ detections = sv.Detections(
87
+ xyxy=xyxy,
88
+ confidence=confidences,
89
+ class_id=class_ids
90
+ )
91
+
92
+ # Prepare labels for label annotator
93
+ labels = [
94
+ f"{class_name} {confidence:.2f}"
95
+ for class_name, confidence in zip(class_names, confidences)
96
+ ]
97
+
98
+ # Annotate frame with detection results
99
+ annotated_frame = frame.copy()
100
+ annotated_frame = box_annotator.annotate(scene=annotated_frame, detections=detections)
101
+ annotated_frame = label_annotator.annotate(scene=annotated_frame, detections=detections, labels=labels)
102
+ else:
103
+ # If no detections, use the original frame
104
+ annotated_frame = frame.copy()
105
+
106
+ # Write the annotated frame to the output video
107
+ out.write(annotated_frame)
108
+
109
+ frame_count += 1
110
+ print(f"Processed frame {frame_count}", end='\r')
111
+
112
+ # Release resources
113
+ cap.release()
114
+ out.release()
115
+ print("\nInference complete. Video saved at", output_video_path)
116
+
models/waldo30/run_sliced_inference_with_tracker.py ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import cv2
2
+ import sys
3
+ from sahi.models.yolov8 import Yolov8DetectionModel
4
+ from sahi.predict import get_sliced_prediction
5
+ import supervision as sv
6
+ import numpy as np
7
+
8
+ # Check the number of command-line arguments
9
+ if len(sys.argv) != 8:
10
+ print("Usage: python yolov8_video_inference.py <model_path> <input_video_path> <output_video_path> <slice_height> <slice_width> <overlap_height_ratio> <overlap_width_ratio>")
11
+ sys.exit(1)
12
+
13
+ # Get command-line arguments
14
+ model_path = sys.argv[1]
15
+ input_video_path = sys.argv[2]
16
+ output_video_path = sys.argv[3]
17
+ slice_height = int(sys.argv[4])
18
+ slice_width = int(sys.argv[5])
19
+ overlap_height_ratio = float(sys.argv[6])
20
+ overlap_width_ratio = float(sys.argv[7])
21
+
22
+ # Load YOLOv8 model with SAHI
23
+ detection_model = Yolov8DetectionModel(
24
+ model_path=model_path,
25
+ confidence_threshold=0.25,
26
+ device="cuda" # or "cpu"
27
+ )
28
+
29
+ # Get video info
30
+ video_info = sv.VideoInfo.from_video_path(video_path=input_video_path)
31
+
32
+ # Open input video
33
+ cap = cv2.VideoCapture(input_video_path)
34
+ width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
35
+ height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
36
+ fps = cap.get(cv2.CAP_PROP_FPS)
37
+ fourcc = cv2.VideoWriter_fourcc(*"mp4v")
38
+
39
+ # Set up output video writer
40
+ out = cv2.VideoWriter(output_video_path, fourcc, fps, (width, height))
41
+
42
+ # Initialize tracker and smoother
43
+ tracker = sv.ByteTrack(frame_rate=video_info.fps)
44
+ smoother = sv.DetectionsSmoother()
45
+
46
+ # Create bounding box and label annotators
47
+ box_annotator = sv.BoxCornerAnnotator(thickness=2)
48
+ label_annotator = sv.LabelAnnotator(
49
+ text_scale=0.5,
50
+ text_thickness=1,
51
+ text_padding=1
52
+ )
53
+
54
+ # Process each frame
55
+ frame_count = 0
56
+ class_id_to_name = {} # Initialize once to store class_id to name mapping
57
+
58
+ while cap.isOpened():
59
+ ret, frame = cap.read()
60
+ if not ret:
61
+ break
62
+
63
+ # Perform sliced inference on the current frame using SAHI
64
+ result = get_sliced_prediction(
65
+ image=frame,
66
+ detection_model=detection_model,
67
+ slice_height=slice_height,
68
+ slice_width=slice_width,
69
+ overlap_height_ratio=overlap_height_ratio,
70
+ overlap_width_ratio=overlap_width_ratio
71
+ )
72
+
73
+ # Extract data from SAHI result
74
+ object_predictions = result.object_prediction_list
75
+
76
+ # Initialize lists to hold the data
77
+ xyxy = []
78
+ confidences = []
79
+ class_ids = []
80
+ # Build or update class_id to name mapping
81
+ for pred in object_predictions:
82
+ if pred.category.id not in class_id_to_name:
83
+ class_id_to_name[pred.category.id] = pred.category.name
84
+
85
+ # Loop over the object predictions and extract data
86
+ for pred in object_predictions:
87
+ bbox = pred.bbox.to_xyxy() # Convert bbox to [x1, y1, x2, y2]
88
+ xyxy.append(bbox)
89
+ confidences.append(pred.score.value)
90
+ class_ids.append(pred.category.id)
91
+
92
+ # Check if there are any detections
93
+ if xyxy:
94
+ # Convert lists to numpy arrays
95
+ xyxy = np.array(xyxy, dtype=np.float32)
96
+ confidences = np.array(confidences, dtype=np.float32)
97
+ class_ids = np.array(class_ids, dtype=int)
98
+
99
+ # Create sv.Detections object
100
+ detections = sv.Detections(
101
+ xyxy=xyxy,
102
+ confidence=confidences,
103
+ class_id=class_ids
104
+ )
105
+
106
+ # Update tracker with detections
107
+ detections = tracker.update_with_detections(detections)
108
+
109
+ # Update smoother with detections
110
+ detections = smoother.update_with_detections(detections)
111
+
112
+ # Prepare labels for label annotator
113
+ # Include tracker ID in labels if available
114
+ labels = []
115
+ for i in range(len(detections.xyxy)):
116
+ class_id = detections.class_id[i]
117
+ confidence = detections.confidence[i]
118
+ class_name = class_id_to_name.get(class_id, 'Unknown')
119
+ label = f"{class_name} {confidence:.2f}"
120
+
121
+ # Add tracker ID if available
122
+ if hasattr(detections, 'tracker_id') and detections.tracker_id is not None:
123
+ tracker_id = detections.tracker_id[i]
124
+ label = f"ID {tracker_id} {label}"
125
+
126
+ labels.append(label)
127
+
128
+ # Annotate frame with detection results
129
+ annotated_frame = frame.copy()
130
+ annotated_frame = box_annotator.annotate(
131
+ scene=annotated_frame,
132
+ detections=detections
133
+ )
134
+ annotated_frame = label_annotator.annotate(
135
+ scene=annotated_frame,
136
+ detections=detections,
137
+ labels=labels
138
+ )
139
+ else:
140
+ # If no detections, use the original frame
141
+ annotated_frame = frame.copy()
142
+
143
+ # Write the annotated frame to the output video
144
+ out.write(annotated_frame)
145
+
146
+ frame_count += 1
147
+ print(f"Processed frame {frame_count}", end='\r')
148
+
149
+ # Release resources
150
+ cap.release()
151
+ out.release()
152
+ print("\nInference complete. Video saved at", output_video_path)
models/waldo30/source.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ https://huggingface.co/StephanST/WALDO30