@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 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://raw.githubusercontent.com/ultralytics/assets/main/docs/ultralytics-yolov8-tasks-banner.avif" alt="Ultralytics YOLO supported tasks">
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://raw.githubusercontent.com/ultralytics/assets/main/docs/ultralytics-yolov8-tasks-banner.avif" alt="Ultralytics YOLO 支持的任务">
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. An explicit choice is honored;
29
- * `"auto"` feature-detects a WebGPU adapter and otherwise falls back to CPU.
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" || pref === "webgpu")
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultralytics/yolo",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "Run Ultralytics YOLO models in the browser on WebGPU (WebAssembly, ONNX Runtime Web via ort-web).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/pkg/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ultralytics-inference-web",
3
3
  "type": "module",
4
4
  "description": "Browser/WebAssembly bindings for ultralytics-inference (WebGPU via ort-web)",
5
- "version": "0.0.34",
5
+ "version": "0.0.35",
6
6
  "license": "AGPL-3.0",
7
7
  "repository": {
8
8
  "type": "git",