Closed pappikko closed 5 months ago
To resolve this issue, I followed these steps:
Copied the content of https://staticimgly.com/@imgly/background-removal-data/1.5.1/dist/resources.json
to the public/
directory of my Nuxt 3 project.
Downloaded the Wasm and ONNX neural networks referenced in the above resources.json
and placed them in the public/
directory as well.
https://staticimgly.com/@imgly/background-removal-data/1.5.1/dist/<hash>
Downgraded @imgly/background-removal
to version 1.5.1. reference: https://github.com/imgly/background-removal-js/issues/124
npm install @imgly/background-removal@1.5.1
Configured the publicPath
in the Config
object to point to the local server.
import type { Config } from "@imgly/background-removal";
import { removeBackground } from "@imgly/background-removal";
let image_src: ImageData | ArrayBuffer | Uint8Array | Blob | URL | string = 'https://source.unsplash.com/1600x900/?dog';
let config: Config = {
debug: true,
publicPath: 'http://localhost:3000/',
};
removeBackground(image_src, config);
This implementation is specific to Nuxt 3.
Hi, we had some problems due to the package size limit of NPM. We had to move the data to the cdn and now provide a prepackaged downloadable package See #127
Description
I am using
@imgly/background-removal
in a Nuxt 3 application with the following versions:While trying to use the package, I encountered an error indicating that the
/models/isnet_quint8
resource is not found. This issue seems to be due to the absence of the model in theresources.json
file retrieved from@imgly/background-removal-data
.Error Message
Details
resources.json
file fetched from@imgly/background-removal-data
does not contain the/models/isnet_quint8
model.resources.json
hosted on IMG.LY (https://staticimgly.com/@imgly/background-removal-data/1.5.1/dist/resources.json
) does include/models/isnet_quint8
.Request
Please update
@imgly/background-removal-data
to include the missing/models/isnet_quint8
in theresources.json
file, or provide guidance on how to correctly configure the model path to resolve this issue.