Merge pull request #18580 from calixteman/alt_text_pass_buffer
[Editor] Pass a buffer instead of a typed array when passing image data to the model
This commit is contained in:
commit
40aa593b1f
@ -169,7 +169,9 @@ class StampEditor extends AnnotationEditor {
|
|||||||
const response = await mlManager.guess({
|
const response = await mlManager.guess({
|
||||||
name: "altText",
|
name: "altText",
|
||||||
request: {
|
request: {
|
||||||
data,
|
// Pass a buffer to avoid copy, see "run" method in:
|
||||||
|
// https://searchfox.org/mozilla-central/source/toolkit/components/ml/actors/MLEngineParent.sys.mjs
|
||||||
|
data: data.buffer,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
channels: data.length / (width * height),
|
channels: data.length / (width * height),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user