Closed mrbob64 closed 8 months ago
@mrbob64 I had a similar error trying to run this in a mono repo. Setting the publicPath
worked better:
const publicPath = path.join(
__dirname,
'..',
'..',
'..',
'node_modules',
'@imgly',
'background-removal-node',
'dist',
);
const blob = await removeBackground(image_src, {
publicPath: `file://${publicPath}/`,
})
.then((blob: Blob) => {
// The result is a blob encoded as PNG. It can be converted to an URL to be used as HTMLImage.src
return blob;
});
Hi, I try to use @imgly/background-removal-node (from folder of this repo) in packages/node-examples. I built @imgly/background-removal-node in packages/node. Then I go to packages/node-examples and build&run. I got error: 'Error: Failed to create session: Error: Failed to load model because protobuf parsing failed.. Please check if the publicPath is set correctly.' What's the problem? I didn't change anything