@ultralytics/yolo 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/index.js +10 -12
- package/package.json +1 -1
- package/pkg/package.json +1 -1
- package/pkg/ultralytics_inference_web_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -118,7 +118,7 @@ async function frame() {
|
|
|
118
118
|
## ✨ Models
|
|
119
119
|
|
|
120
120
|
<a href="https://docs.ultralytics.com/tasks" target="_blank">
|
|
121
|
-
<img width="100%" src="https://
|
|
121
|
+
<img width="100%" src="https://cdn.ul.run/i/c99d914c3958d0755b5a3d7204b6f24a.avif" alt="Ultralytics YOLO supported tasks">
|
|
122
122
|
</a>
|
|
123
123
|
<br>
|
|
124
124
|
<br>
|
package/README.zh-CN.md
CHANGED
|
@@ -112,7 +112,7 @@ async function frame() {
|
|
|
112
112
|
## ✨ 模型
|
|
113
113
|
|
|
114
114
|
<a href="https://docs.ultralytics.com/tasks" target="_blank">
|
|
115
|
-
<img width="100%" src="https://
|
|
115
|
+
<img width="100%" src="https://cdn.ul.run/i/c99d914c3958d0755b5a3d7204b6f24a.avif" alt="Ultralytics YOLO 支持的任务">
|
|
116
116
|
</a>
|
|
117
117
|
<br>
|
|
118
118
|
<br>
|
package/dist/index.js
CHANGED
|
@@ -25,21 +25,19 @@ function poseScheme() {
|
|
|
25
25
|
return poseSchemeCache;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Resolve the device string passed to wasm.
|
|
29
|
-
*
|
|
28
|
+
* Resolve the device string passed to wasm. `"cpu"` is honored as-is; anything else
|
|
29
|
+
* needs a real adapter, since `navigator.gpu` can exist while `requestAdapter()`
|
|
30
|
+
* still returns `null` — so `YOLO.device` reports what actually ran.
|
|
30
31
|
*/
|
|
31
32
|
async function resolveDevice(pref) {
|
|
32
|
-
if (pref === "cpu"
|
|
33
|
-
return pref;
|
|
34
|
-
const gpu = navigator.gpu;
|
|
35
|
-
if (!gpu)
|
|
36
|
-
return "cpu";
|
|
37
|
-
try {
|
|
38
|
-
return (await gpu.requestAdapter()) ? "webgpu" : "cpu";
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
33
|
+
if (pref === "cpu")
|
|
41
34
|
return "cpu";
|
|
42
|
-
|
|
35
|
+
const gpu = navigator.gpu;
|
|
36
|
+
if (await gpu?.requestAdapter().catch(() => null))
|
|
37
|
+
return "webgpu";
|
|
38
|
+
if (pref === "webgpu")
|
|
39
|
+
console.warn("[@ultralytics/yolo] WebGPU requested but no adapter found; running on CPU.");
|
|
40
|
+
return "cpu";
|
|
43
41
|
}
|
|
44
42
|
/** Ultralytics model assets release (ONNX exports of yolo26 / yolo11 / yolov8). */
|
|
45
43
|
const ASSETS = "https://github.com/ultralytics/assets/releases/download/v8.4.0/";
|
package/package.json
CHANGED
package/pkg/package.json
CHANGED
|
Binary file
|