-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node.JS wrapper for EfficientDet #7867
Comments
Hi, @lukemovement Thank you for writing Node.JS wrapper for Here is error log for your reference :
|
It sounds like you are using an older version of NodeJS than me. Use this to test the model instead. const main = async () => {
// get object detection result
const imagePath = resolve(process.cwd(), "sample_in.jpg");
const image = await fs.readFile(imagePath);
const model = new EfficientDet();
await model.loadModel();
const result = await model.predict(image);
// draw boxes on image
const imageTensor = tf.node.decodeImage(image, 3) as tf.Tensor3D;
const highlightedImageTensor = await model.drawBoxesOnImage(
imageTensor,
result,
);
// write image to file
const output = await tf.node.encodeJpeg(
highlightedImageTensor as tf.Tensor3D,
);
await fs.writeFile(resolve(process.cwd(), "sample_out.jpg"), output);
};
main(); |
Hi, @lukemovement Thank you for sharing your code and I tried your first code snippet with latest version of
|
I have recently written a wrapper for EfficientDet but I don't really have the time to oversee getting it added as a PR due to personal commitments. The code seems to be fully functional. The input size of the model can be changed by replacing all instances of
1536
within the sample.Feel free to use or close the ticket :)
The text was updated successfully, but these errors were encountered: