Issues classifying images that are slighly blurred
See original GitHub issueThis 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;
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Review — Comparative Study of Classifiers for Blurred ...
A test image (I) is classified as “slightly blurred”, “moderately blurred” or “strongly blurred” according to the three labels based on the Differential...
Read more >Effects of Image Degradations to CNN-based Image ... - arXiv
In this paper, we investi- gate the problems of general degraded image classification, by covering hazy images, motion blurs, underwater blurs, ...
Read more >(PDF) Detecting and Classifying Blurred Image Regions
In this paper, we propose a partially-blurred-image classification and analysis framework for automatically detecting images containing blurred ...
Read more >5 Reasons to Blur Images at Work (When in Doubt, Blur it Out)
Blur parts of an image can help you share the information you need while protecting sensitive information that may also be present.
Read more >A Robust Approach for Blur and Sharp Regions' Detection ...
Accurate segmentation of homogenous smooth and blur regions, low-contrast focal regions, missing patches, and background clutter, without having ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@aw1875 Our package is a re-implementation of this tensorflow code, it seems to be an issue with object detection models in general (see this paper)
Alright so it’s just a general issue for image detection as a whole, thank you for the information!