Issues classifying images that are slighly blurred
This may not be considered a bug as the code may be functioning properly so I wanted to drop this here.
System information
- Tested on Ubuntu 22.04 and Windows 10
- TFJS installed via yarn
- TFJS version 3.19.0
- I have written custom code (see snippet below)
Describe the current behavior It seems like TFJS paired with the cocossd model is having issues with images that are blurred or slightly blurry.
Describe the expected behavior Expecting normal image classification as per usual.
Code Snippet
For reference, this code is ran in a try/catch so I can manually throw an error if the image arraybuffer request fails. This code is also written in TypeScript which is why I am casting the response from decodeImage to a Tensor3D object for coco to attempt to detect.
import tf, { Tensor3D } from '@tensorflow/tfjs-node'
import cocossd from '@tensorflow-models/coco-ssd'
import axios from 'axios'
// Get Image as arraybuffer
const blob = await axios.get(uri, { responseType: 'arraybuffer' })
.then((res) => res.data)
.catch((err) => { throw err; });
// Load Model
const model = await cocossd.load();
// Get Predictions
const predictions = await model.detect(tf.node.decodeImage(blob) as Tensor3D) // Leaving the default boxes and confidence
return predictions;
It is working on blurred images as well , here is one example , can you please share the images if possible which you are using , thank you

@rthadur It does work, but sometimes it has issues is just what I've noticed. I don't have a photo from my testing handy currently but I can try and grab out later as an example.
sure , Thank you
@rthadur Here's one of the examples from my testing:
