Remove error check that canvas must be defined
PiperOrigin-RevId: 529906685
This commit is contained in:
parent
6aad5742c3
commit
fb7f06b509
|
@ -59,11 +59,6 @@ export abstract class VisionTaskRunner extends TaskRunner {
|
||||||
protected static async createVisionInstance<T extends VisionTaskRunner>(
|
protected static async createVisionInstance<T extends VisionTaskRunner>(
|
||||||
type: WasmMediaPipeConstructor<T>, fileset: WasmFileset,
|
type: WasmMediaPipeConstructor<T>, fileset: WasmFileset,
|
||||||
options: VisionTaskOptions): Promise<T> {
|
options: VisionTaskOptions): Promise<T> {
|
||||||
if (options.baseOptions?.delegate === 'GPU') {
|
|
||||||
if (!options.canvas) {
|
|
||||||
throw new Error('You must specify a canvas for GPU processing.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const canvas = options.canvas ?? createCanvas();
|
const canvas = options.canvas ?? createCanvas();
|
||||||
return TaskRunner.createInstance(type, canvas, fileset, options);
|
return TaskRunner.createInstance(type, canvas, fileset, options);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user