question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues classifying images that are slighly blurred

See original GitHub issue

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;

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ahmedsabiecommented, Aug 11, 2022

@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)

0reactions
aw1875commented, Aug 12, 2022

@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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found