@ultralytics/yolo 0.0.39 → 0.0.41
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 +2 -2
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/pkg/package.json +1 -1
- package/pkg/ultralytics_inference_web.d.ts +4 -4
- package/pkg/ultralytics_inference_web.js +15 -15
- package/pkg/ultralytics_inference_web_bg.wasm +0 -0
- package/pkg/ultralytics_inference_web_bg.wasm.d.ts +4 -4
package/README.md
CHANGED
|
@@ -223,8 +223,8 @@ Only the inference engine changes; the preprocessing, postprocessing, drawing,
|
|
|
223
223
|
and `Results` shape are the same shared Rust code, so output matches the `ort`
|
|
224
224
|
path.
|
|
225
225
|
|
|
226
|
-
The backend is picked from the file extension
|
|
227
|
-
`.onnx` on ONNX Runtime Web. The LiteRT.js wasm loads from a CDN by default, so
|
|
226
|
+
The backend is picked from the file extension, falling back to sniffing the `TFL3`
|
|
227
|
+
magic bytes: a `.tflite` runs on LiteRT.js, a `.onnx` on ONNX Runtime Web. The LiteRT.js wasm loads from a CDN by default, so
|
|
228
228
|
the only setup is making `@litertjs/core` resolve (along with its `@litertjs/wasm-utils`
|
|
229
229
|
dependency, which npm installs automatically and the import map below lists explicitly).
|
|
230
230
|
|
package/dist/index.d.ts
CHANGED
|
@@ -82,7 +82,9 @@ export interface LoadOptions {
|
|
|
82
82
|
* Optional base URL to self-host the ONNX Runtime Web build instead of
|
|
83
83
|
* fetching it from `cdn.pyke.io`. The directory must contain
|
|
84
84
|
* `ort.webgpu.min.js`, `ort-wasm-simd-threaded.jsep.wasm`, and
|
|
85
|
-
* `ort-wasm-simd-threaded.jsep.mjs
|
|
85
|
+
* `ort-wasm-simd-threaded.jsep.mjs` for WebGPU, plus `ort.wasm.min.js` and
|
|
86
|
+
* `ort-wasm-simd-threaded.wasm` for the CPU build, which is what a `"cpu"`
|
|
87
|
+
* device and the WebGPU fallback below load. Use an absolute URL ending in `/`.
|
|
86
88
|
*/
|
|
87
89
|
ortBaseUrl?: string | URL;
|
|
88
90
|
/**
|
|
@@ -169,7 +171,7 @@ export declare class YOLO {
|
|
|
169
171
|
private static loadLiteRt;
|
|
170
172
|
/** The model's task (`detect`, `segment`, `pose`, `classify`, `obb`, `semantic`, `depth`). */
|
|
171
173
|
get task(): string;
|
|
172
|
-
/** The active device that ran inference (`"webgpu"
|
|
174
|
+
/** The active device that ran inference (`"webgpu"` or `"cpu"`). */
|
|
173
175
|
get device(): string;
|
|
174
176
|
/** Class id -> name map (like Ultralytics `model.names`). */
|
|
175
177
|
get names(): Record<number, string>;
|
|
@@ -182,7 +184,7 @@ export declare class YOLO {
|
|
|
182
184
|
* are decoded (in wasm for `ort`, via a canvas for `litert`).
|
|
183
185
|
*
|
|
184
186
|
* @param image The image to run on.
|
|
185
|
-
* @param options Confidence/IoU thresholds.
|
|
187
|
+
* @param options Confidence/IoU thresholds, class filter, and depth colorizing.
|
|
186
188
|
*/
|
|
187
189
|
predict(image: ImageInput, options?: PredictOptions): Promise<Results>;
|
|
188
190
|
/** Release the underlying wasm model/engine. Call when you are done with it. */
|
package/dist/index.js
CHANGED
|
@@ -398,7 +398,7 @@ export class YOLO {
|
|
|
398
398
|
get task() {
|
|
399
399
|
return this.engine.task;
|
|
400
400
|
}
|
|
401
|
-
/** The active device that ran inference (`"webgpu"
|
|
401
|
+
/** The active device that ran inference (`"webgpu"` or `"cpu"`). */
|
|
402
402
|
get device() {
|
|
403
403
|
return this.engine.device;
|
|
404
404
|
}
|
|
@@ -415,7 +415,7 @@ export class YOLO {
|
|
|
415
415
|
* are decoded (in wasm for `ort`, via a canvas for `litert`).
|
|
416
416
|
*
|
|
417
417
|
* @param image The image to run on.
|
|
418
|
-
* @param options Confidence/IoU thresholds.
|
|
418
|
+
* @param options Confidence/IoU thresholds, class filter, and depth colorizing.
|
|
419
419
|
*/
|
|
420
420
|
async predict(image, options) {
|
|
421
421
|
const conf = options?.conf ?? DEFAULT_CONF;
|
package/package.json
CHANGED
package/pkg/package.json
CHANGED
|
@@ -200,10 +200,10 @@ export interface InitOutput {
|
|
|
200
200
|
readonly yolopipeline_setInputShape: (a: number, b: number, c: number) => void;
|
|
201
201
|
readonly yolopipeline_task: (a: number, b: number) => void;
|
|
202
202
|
readonly start: () => void;
|
|
203
|
-
readonly
|
|
204
|
-
readonly
|
|
205
|
-
readonly
|
|
206
|
-
readonly
|
|
203
|
+
readonly __wasm_bindgen_func_elem_1996: (a: number, b: number, c: number, d: number) => void;
|
|
204
|
+
readonly __wasm_bindgen_func_elem_2601: (a: number, b: number, c: number, d: number) => void;
|
|
205
|
+
readonly __wasm_bindgen_func_elem_1996_2: (a: number, b: number, c: number, d: number) => void;
|
|
206
|
+
readonly __wasm_bindgen_func_elem_2625: (a: number, b: number, c: number, d: number) => void;
|
|
207
207
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
208
208
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
209
209
|
readonly __wbindgen_export3: (a: number) => void;
|
|
@@ -734,7 +734,7 @@ function __wbg_get_imports() {
|
|
|
734
734
|
const a = state0.a;
|
|
735
735
|
state0.a = 0;
|
|
736
736
|
try {
|
|
737
|
-
return
|
|
737
|
+
return __wasm_bindgen_func_elem_2625(a, state0.b, arg0, arg1);
|
|
738
738
|
} finally {
|
|
739
739
|
state0.a = a;
|
|
740
740
|
}
|
|
@@ -924,18 +924,18 @@ function __wbg_get_imports() {
|
|
|
924
924
|
return addHeapObject(ret);
|
|
925
925
|
},
|
|
926
926
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
927
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
928
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
927
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 696, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
928
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1996);
|
|
929
929
|
return addHeapObject(ret);
|
|
930
930
|
},
|
|
931
931
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
932
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
933
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
932
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 924, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
933
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_2601);
|
|
934
934
|
return addHeapObject(ret);
|
|
935
935
|
},
|
|
936
936
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
937
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("boolean")], shim_idx:
|
|
938
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
937
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("boolean")], shim_idx: 696, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
938
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1996_2);
|
|
939
939
|
return addHeapObject(ret);
|
|
940
940
|
},
|
|
941
941
|
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
@@ -1022,10 +1022,10 @@ function __wbg_get_imports() {
|
|
|
1022
1022
|
};
|
|
1023
1023
|
}
|
|
1024
1024
|
|
|
1025
|
-
function
|
|
1025
|
+
function __wasm_bindgen_func_elem_1996(arg0, arg1, arg2) {
|
|
1026
1026
|
try {
|
|
1027
1027
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1028
|
-
wasm.
|
|
1028
|
+
wasm.__wasm_bindgen_func_elem_1996(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1029
1029
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1030
1030
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1031
1031
|
if (r1) {
|
|
@@ -1036,10 +1036,10 @@ function __wasm_bindgen_func_elem_1984(arg0, arg1, arg2) {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
|
-
function
|
|
1039
|
+
function __wasm_bindgen_func_elem_2601(arg0, arg1, arg2) {
|
|
1040
1040
|
try {
|
|
1041
1041
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1042
|
-
wasm.
|
|
1042
|
+
wasm.__wasm_bindgen_func_elem_2601(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1043
1043
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1044
1044
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1045
1045
|
if (r1) {
|
|
@@ -1050,10 +1050,10 @@ function __wasm_bindgen_func_elem_2589(arg0, arg1, arg2) {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
1052
|
|
|
1053
|
-
function
|
|
1053
|
+
function __wasm_bindgen_func_elem_1996_2(arg0, arg1, arg2) {
|
|
1054
1054
|
try {
|
|
1055
1055
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1056
|
-
wasm.
|
|
1056
|
+
wasm.__wasm_bindgen_func_elem_1996_2(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1057
1057
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1058
1058
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1059
1059
|
if (r1) {
|
|
@@ -1064,8 +1064,8 @@ function __wasm_bindgen_func_elem_1984_2(arg0, arg1, arg2) {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
1066
|
|
|
1067
|
-
function
|
|
1068
|
-
wasm.
|
|
1067
|
+
function __wasm_bindgen_func_elem_2625(arg0, arg1, arg2, arg3) {
|
|
1068
|
+
wasm.__wasm_bindgen_func_elem_2625(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
1069
1069
|
}
|
|
1070
1070
|
|
|
1071
1071
|
|
|
Binary file
|
|
@@ -19,10 +19,10 @@ export const yolopipeline_preprocess_rgba: (a: number, b: number, c: number, d:
|
|
|
19
19
|
export const yolopipeline_setInputShape: (a: number, b: number, c: number) => void;
|
|
20
20
|
export const yolopipeline_task: (a: number, b: number) => void;
|
|
21
21
|
export const start: () => void;
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
22
|
+
export const __wasm_bindgen_func_elem_1996: (a: number, b: number, c: number, d: number) => void;
|
|
23
|
+
export const __wasm_bindgen_func_elem_2601: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
+
export const __wasm_bindgen_func_elem_1996_2: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
+
export const __wasm_bindgen_func_elem_2625: (a: number, b: number, c: number, d: number) => void;
|
|
26
26
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
27
27
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export3: (a: number) => void;
|