diff --git a/static/background-blur-worker.js b/static/background-blur-worker.js index e5ef1db..c6d3f54 100644 --- a/static/background-blur-worker.js +++ b/static/background-blur-worker.js @@ -12,7 +12,7 @@ async function loadImageSegmenter() { imageSegmenter = await module.ImageSegmenter.createFromOptions(vision, { baseOptions: { - modelAssetPath: '/third-party/tasks-vision/selfie_segmenter.tflite', + modelAssetPath: '/third-party/tasks-vision/models/selfie_segmenter.tflite', }, outputCategoryMask: true, outputConfidenceMasks: false, diff --git a/static/galene.js b/static/galene.js index b2d8c92..2eacbb6 100644 --- a/static/galene.js +++ b/static/galene.js @@ -1025,6 +1025,7 @@ function cancelReconsiderParameters() { /** * @typedef {Object} filterDefinition * @property {string} [description] + * @property {(this: filterDefinition) => Promise} [predicate] * @property {(this: Filter) => Promise} [init] * @property {(this: Filter) => Promise} [cleanup] * @property {(this: Filter, src: HTMLVideoElement, ctx: CanvasRenderingContext2D) => Promise} draw @@ -1286,9 +1287,13 @@ let filters = { }, }; -function addFilters() { +async function addFilters() { for(let name in filters) { let f = filters[name]; + if(f.predicate) { + if(!(await f.predicate.call(f))) + continue; + } let d = f.description || name; addSelectOption(getSelectElement('filterselect'), d, name); } @@ -4220,7 +4225,7 @@ async function start() { window.history.replaceState(null, '', window.location.pathname); setTitle(groupStatus.displayName || capitalise(group)); - addFilters(); + await addFilters(); await setMediaChoices(false); reflectSettings();