This plugin is a Python plugin that allows you to find common issues in your image datasets.
With this plugin, you can find the following issues:
- π Aspect ratio: find images with weird aspect ratios
- π«οΈ Blurriness: find blurry images
- βοΈ Brightness: find bright and dark images
- π Contrast: find images with high or low contrast
- π Entropy: find images with low entropy
- πΈ Exposure: find overexposed and underexposed images
- π―οΈ Illumination: find images with uneven illumination
- π§ Noise: find images with high salt and pepper noise
- π Saturation: find images with low and high saturation
For any of these properties, the plugin allows you to compute with the following options:
- In real-time, or in delegated execution mode
- For full images, or for any object patches, specified by a
Detections
field - for the entire dataset, the current view, or for currently selected samples
These computations are all united via a find_issues
operator, which allows you to designate images (or detections) as plagued by specific issues. You can run the issue-finding operator in single-issue or multi-issue mode, and can specify the threshold for each issue at the time of execution. All necessary computations which have not yet been run will be run.
- 2023-11-13: Version 2.0.1 supports calling the compute methods from the Python SDK!
- 2023-11-10: Version 2.0.0 adds support for object patches, lots of refactoring, and more robustness!
fiftyone plugins download https://github.com/jacobmarks/image-quality-issues/
Relatively self-explanatory, this is the raio of image (or patch) width to height. The minimum of width/height
and height/width
is computed.
Operator: compute_aspect_ratio
Compute aspect ratio of images:
Compute aspect ratio of detection patches:
Blurriness measures the lack of sharpness, or clarity in the image. It encapsulates multiple sources, including motion blur, defocus blur, and low-quality imaging. You can compute blurriness with the compute_blurriness
operator.
Brightness attempts to quantify the amount of light in an image, as it is perceived by the viewer. For RGB images, it is computed by taking a weighted average of the RGB channels for each pixel and computing a luminance score. You can run the computation with compute_brightness
.
This brightness score allows you to identify dark images and bright images.
Contrast measures the difference in brightness between the darkest and brightest parts of an image. Low contrast means high uniformity across the image. You can compute the contrast for your images or patches with compute_contrast
.
Entropy quantifies the information content of the pixels in an image. The more complex the visual structure, the higher the entropy. Low entropy images typically provide little information to a model, so it may be desired to remove them from the dataset before training. Compute entropy with compute_entropy
.
Exposure measures the amount of light per unit area reaching the image sensor or film. It is related to but distinct from brightness. Low exposure and high exposure can both be issues that plague images captured by cameras. Compute exposure with compute_exposure
.
Salt and pepper noise is a variety of noise in images that comes in the form of black and white pixels. It can result in grainy images, or images which are hard to make accurate predictions on. Compute the salt and pepper noise with compute_salt_and_pepper
.
Saturation measures the intensity or purity of color in an image. Grayscale images have low saturation, whereas vivid, rich images have high saturation. Compute saturation with compute_saturation
.
Vignetting measures the dropoff in brightness and saturation near the periphery of an image compared to at its center. This can be an undesired consequence of camera settings. Compute vignetting with compute_vignetting
.
Finds images with brightness, aspect ratio, or entropy issues. You can specify the threshold for each issue type, and which issue types to check for.
You can also use the compute operators from the Python SDK!
import fiftyone as fo
import fiftyone.operators as foo
import fiftyone.zoo as foz
dataset = fo.load_dataset("quickstart")
## Access the operator via its URI (plugin name + operator name)
compute_brightness = foo.get_operator(
"@jacobmarks/image_issues/compute_brightness"
)
## Compute the brightness of all images in the dataset
compute_brightness(dataset)
## Compute brightness of a view
view = dataset.take(10)
compute_brightness(view)
## Compute brightness of detection patches
compute_brightness(dataset, patches_field="ground_truth")
Note: The find_issues
operator is not yet supported in the Python SDK.
Note: You may have trouble running these within a Jupyter notebook. If so, try running them in a Python script.
Here are some related projects that this plugin is inspired by and adapted from:
- BlurDetection2 with OpenCV
- CleanLab's CleanVision
- Exposure_Correction
- Lakera's MLTest