🚩 Create a free WhyLabs account to get more value out of whylogs!
Did you know you can store, visualize, and monitor whylogs profiles with the WhyLabs Observability Platform? Sign up for a free WhyLabs account to leverage the power of whylogs and WhyLabs together!
Whylogs has optional support for logging data about images. This example demonstrates how to use whylogs with image data.
Whylogs uses Pillow for working with images. To install whylogs with the optional image support enabled, use the following:
# Note: you may need to restart the kernel to use updated packages.
%pip install 'whylogs[image,whylabs]'
This will install all the dependencies whylogs needs to work with image data.
The log_image()
function provides a simple interface for logging images.
from PIL import Image
from whylogs.extras.image_metric import log_image
img1 = Image.effect_mandelbrot((256, 256), (-3, -2.5, 2, 2.5), 9)
img2 = Image.effect_mandelbrot((256, 256), (-3, -2.5, 2, 2.5), 20)
display(img1)
display(img2)
results = log_image(img1)
print(results.view().get_column("image").to_summary_dict())
{'image/ImagePixelWidth:counts/n': 1, 'image/ImagePixelWidth:counts/null': 0, 'image/ImagePixelWidth:types/integral': 1, 'image/ImagePixelWidth:types/fractional': 0, 'image/ImagePixelWidth:types/boolean': 0, 'image/ImagePixelWidth:types/string': 0, 'image/ImagePixelWidth:types/object': 0, 'image/ImagePixelWidth:cardinality/est': 1.0, 'image/ImagePixelWidth:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelWidth:cardinality/lower_1': 1.0, 'image/ImagePixelWidth:distribution/mean': 256.0, 'image/ImagePixelWidth:distribution/stddev': 0.0, 'image/ImagePixelWidth:distribution/n': 1, 'image/ImagePixelWidth:distribution/max': 256.0, 'image/ImagePixelWidth:distribution/min': 256.0, 'image/ImagePixelWidth:distribution/q_01': 256.0, 'image/ImagePixelWidth:distribution/q_05': 256.0, 'image/ImagePixelWidth:distribution/q_10': 256.0, 'image/ImagePixelWidth:distribution/q_25': 256.0, 'image/ImagePixelWidth:distribution/median': 256.0, 'image/ImagePixelWidth:distribution/q_75': 256.0, 'image/ImagePixelWidth:distribution/q_90': 256.0, 'image/ImagePixelWidth:distribution/q_95': 256.0, 'image/ImagePixelWidth:distribution/q_99': 256.0, 'image/ImagePixelWidth:ints/max': 256, 'image/ImagePixelWidth:ints/min': 256, 'image/ImagePixelWidth:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/ImagePixelHeight:counts/n': 1, 'image/ImagePixelHeight:counts/null': 0, 'image/ImagePixelHeight:types/integral': 1, 'image/ImagePixelHeight:types/fractional': 0, 'image/ImagePixelHeight:types/boolean': 0, 'image/ImagePixelHeight:types/string': 0, 'image/ImagePixelHeight:types/object': 0, 'image/ImagePixelHeight:cardinality/est': 1.0, 'image/ImagePixelHeight:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelHeight:cardinality/lower_1': 1.0, 'image/ImagePixelHeight:distribution/mean': 256.0, 'image/ImagePixelHeight:distribution/stddev': 0.0, 'image/ImagePixelHeight:distribution/n': 1, 'image/ImagePixelHeight:distribution/max': 256.0, 'image/ImagePixelHeight:distribution/min': 256.0, 'image/ImagePixelHeight:distribution/q_01': 256.0, 'image/ImagePixelHeight:distribution/q_05': 256.0, 'image/ImagePixelHeight:distribution/q_10': 256.0, 'image/ImagePixelHeight:distribution/q_25': 256.0, 'image/ImagePixelHeight:distribution/median': 256.0, 'image/ImagePixelHeight:distribution/q_75': 256.0, 'image/ImagePixelHeight:distribution/q_90': 256.0, 'image/ImagePixelHeight:distribution/q_95': 256.0, 'image/ImagePixelHeight:distribution/q_99': 256.0, 'image/ImagePixelHeight:ints/max': 256, 'image/ImagePixelHeight:ints/min': 256, 'image/ImagePixelHeight:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/Colorspace:counts/n': 1, 'image/Colorspace:counts/null': 0, 'image/Colorspace:types/integral': 0, 'image/Colorspace:types/fractional': 0, 'image/Colorspace:types/boolean': 0, 'image/Colorspace:types/string': 1, 'image/Colorspace:types/object': 0, 'image/Colorspace:cardinality/est': 1.0, 'image/Colorspace:cardinality/upper_1': 1.000049929250618, 'image/Colorspace:cardinality/lower_1': 1.0, 'image/Colorspace:frequent_items/frequent_strings': [FrequentItem(value='L', est=1, upper=1, lower=1)], 'image/Hue.mean:counts/n': 1, 'image/Hue.mean:counts/null': 0, 'image/Hue.mean:types/integral': 0, 'image/Hue.mean:types/fractional': 1, 'image/Hue.mean:types/boolean': 0, 'image/Hue.mean:types/string': 0, 'image/Hue.mean:types/object': 0, 'image/Hue.mean:cardinality/est': 1.0, 'image/Hue.mean:cardinality/upper_1': 1.000049929250618, 'image/Hue.mean:cardinality/lower_1': 1.0, 'image/Hue.mean:distribution/mean': 0.0, 'image/Hue.mean:distribution/stddev': 0.0, 'image/Hue.mean:distribution/n': 1, 'image/Hue.mean:distribution/max': 0.0, 'image/Hue.mean:distribution/min': 0.0, 'image/Hue.mean:distribution/q_01': 0.0, 'image/Hue.mean:distribution/q_05': 0.0, 'image/Hue.mean:distribution/q_10': 0.0, 'image/Hue.mean:distribution/q_25': 0.0, 'image/Hue.mean:distribution/median': 0.0, 'image/Hue.mean:distribution/q_75': 0.0, 'image/Hue.mean:distribution/q_90': 0.0, 'image/Hue.mean:distribution/q_95': 0.0, 'image/Hue.mean:distribution/q_99': 0.0, 'image/Hue.stddev:counts/n': 1, 'image/Hue.stddev:counts/null': 0, 'image/Hue.stddev:types/integral': 0, 'image/Hue.stddev:types/fractional': 1, 'image/Hue.stddev:types/boolean': 0, 'image/Hue.stddev:types/string': 0, 'image/Hue.stddev:types/object': 0, 'image/Hue.stddev:cardinality/est': 1.0, 'image/Hue.stddev:cardinality/upper_1': 1.000049929250618, 'image/Hue.stddev:cardinality/lower_1': 1.0, 'image/Hue.stddev:distribution/mean': 0.0, 'image/Hue.stddev:distribution/stddev': 0.0, 'image/Hue.stddev:distribution/n': 1, 'image/Hue.stddev:distribution/max': 0.0, 'image/Hue.stddev:distribution/min': 0.0, 'image/Hue.stddev:distribution/q_01': 0.0, 'image/Hue.stddev:distribution/q_05': 0.0, 'image/Hue.stddev:distribution/q_10': 0.0, 'image/Hue.stddev:distribution/q_25': 0.0, 'image/Hue.stddev:distribution/median': 0.0, 'image/Hue.stddev:distribution/q_75': 0.0, 'image/Hue.stddev:distribution/q_90': 0.0, 'image/Hue.stddev:distribution/q_95': 0.0, 'image/Hue.stddev:distribution/q_99': 0.0, 'image/Saturation.mean:counts/n': 1, 'image/Saturation.mean:counts/null': 0, 'image/Saturation.mean:types/integral': 0, 'image/Saturation.mean:types/fractional': 1, 'image/Saturation.mean:types/boolean': 0, 'image/Saturation.mean:types/string': 0, 'image/Saturation.mean:types/object': 0, 'image/Saturation.mean:cardinality/est': 1.0, 'image/Saturation.mean:cardinality/upper_1': 1.000049929250618, 'image/Saturation.mean:cardinality/lower_1': 1.0, 'image/Saturation.mean:distribution/mean': 0.0, 'image/Saturation.mean:distribution/stddev': 0.0, 'image/Saturation.mean:distribution/n': 1, 'image/Saturation.mean:distribution/max': 0.0, 'image/Saturation.mean:distribution/min': 0.0, 'image/Saturation.mean:distribution/q_01': 0.0, 'image/Saturation.mean:distribution/q_05': 0.0, 'image/Saturation.mean:distribution/q_10': 0.0, 'image/Saturation.mean:distribution/q_25': 0.0, 'image/Saturation.mean:distribution/median': 0.0, 'image/Saturation.mean:distribution/q_75': 0.0, 'image/Saturation.mean:distribution/q_90': 0.0, 'image/Saturation.mean:distribution/q_95': 0.0, 'image/Saturation.mean:distribution/q_99': 0.0, 'image/Saturation.stddev:counts/n': 1, 'image/Saturation.stddev:counts/null': 0, 'image/Saturation.stddev:types/integral': 0, 'image/Saturation.stddev:types/fractional': 1, 'image/Saturation.stddev:types/boolean': 0, 'image/Saturation.stddev:types/string': 0, 'image/Saturation.stddev:types/object': 0, 'image/Saturation.stddev:cardinality/est': 1.0, 'image/Saturation.stddev:cardinality/upper_1': 1.000049929250618, 'image/Saturation.stddev:cardinality/lower_1': 1.0, 'image/Saturation.stddev:distribution/mean': 0.0, 'image/Saturation.stddev:distribution/stddev': 0.0, 'image/Saturation.stddev:distribution/n': 1, 'image/Saturation.stddev:distribution/max': 0.0, 'image/Saturation.stddev:distribution/min': 0.0, 'image/Saturation.stddev:distribution/q_01': 0.0, 'image/Saturation.stddev:distribution/q_05': 0.0, 'image/Saturation.stddev:distribution/q_10': 0.0, 'image/Saturation.stddev:distribution/q_25': 0.0, 'image/Saturation.stddev:distribution/median': 0.0, 'image/Saturation.stddev:distribution/q_75': 0.0, 'image/Saturation.stddev:distribution/q_90': 0.0, 'image/Saturation.stddev:distribution/q_95': 0.0, 'image/Saturation.stddev:distribution/q_99': 0.0, 'image/Brightness.mean:counts/n': 1, 'image/Brightness.mean:counts/null': 0, 'image/Brightness.mean:types/integral': 0, 'image/Brightness.mean:types/fractional': 1, 'image/Brightness.mean:types/boolean': 0, 'image/Brightness.mean:types/string': 0, 'image/Brightness.mean:types/object': 0, 'image/Brightness.mean:cardinality/est': 1.0, 'image/Brightness.mean:cardinality/upper_1': 1.000049929250618, 'image/Brightness.mean:cardinality/lower_1': 1.0, 'image/Brightness.mean:distribution/mean': 91.99722290039062, 'image/Brightness.mean:distribution/stddev': 0.0, 'image/Brightness.mean:distribution/n': 1, 'image/Brightness.mean:distribution/max': 91.99722290039062, 'image/Brightness.mean:distribution/min': 91.99722290039062, 'image/Brightness.mean:distribution/q_01': 91.99722290039062, 'image/Brightness.mean:distribution/q_05': 91.99722290039062, 'image/Brightness.mean:distribution/q_10': 91.99722290039062, 'image/Brightness.mean:distribution/q_25': 91.99722290039062, 'image/Brightness.mean:distribution/median': 91.99722290039062, 'image/Brightness.mean:distribution/q_75': 91.99722290039062, 'image/Brightness.mean:distribution/q_90': 91.99722290039062, 'image/Brightness.mean:distribution/q_95': 91.99722290039062, 'image/Brightness.mean:distribution/q_99': 91.99722290039062, 'image/Brightness.stddev:counts/n': 1, 'image/Brightness.stddev:counts/null': 0, 'image/Brightness.stddev:types/integral': 0, 'image/Brightness.stddev:types/fractional': 1, 'image/Brightness.stddev:types/boolean': 0, 'image/Brightness.stddev:types/string': 0, 'image/Brightness.stddev:types/object': 0, 'image/Brightness.stddev:cardinality/est': 1.0, 'image/Brightness.stddev:cardinality/upper_1': 1.000049929250618, 'image/Brightness.stddev:cardinality/lower_1': 1.0, 'image/Brightness.stddev:distribution/mean': 41.904298558131785, 'image/Brightness.stddev:distribution/stddev': 0.0, 'image/Brightness.stddev:distribution/n': 1, 'image/Brightness.stddev:distribution/max': 41.904298558131785, 'image/Brightness.stddev:distribution/min': 41.904298558131785, 'image/Brightness.stddev:distribution/q_01': 41.904298558131785, 'image/Brightness.stddev:distribution/q_05': 41.904298558131785, 'image/Brightness.stddev:distribution/q_10': 41.904298558131785, 'image/Brightness.stddev:distribution/q_25': 41.904298558131785, 'image/Brightness.stddev:distribution/median': 41.904298558131785, 'image/Brightness.stddev:distribution/q_75': 41.904298558131785, 'image/Brightness.stddev:distribution/q_90': 41.904298558131785, 'image/Brightness.stddev:distribution/q_95': 41.904298558131785, 'image/Brightness.stddev:distribution/q_99': 41.904298558131785}
As you can see above, just passing in an Image
results in a column named "image" in the profile. You can pass in a list of images, which will append an index to each column name:
results = log_image([img1, img2])
print(list(results.view().get_columns()))
print(results.view().get_column("image_1").to_summary_dict())
['image_0', 'image_1'] {'image/ImagePixelWidth:counts/n': 1, 'image/ImagePixelWidth:counts/null': 0, 'image/ImagePixelWidth:types/integral': 1, 'image/ImagePixelWidth:types/fractional': 0, 'image/ImagePixelWidth:types/boolean': 0, 'image/ImagePixelWidth:types/string': 0, 'image/ImagePixelWidth:types/object': 0, 'image/ImagePixelWidth:cardinality/est': 1.0, 'image/ImagePixelWidth:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelWidth:cardinality/lower_1': 1.0, 'image/ImagePixelWidth:distribution/mean': 256.0, 'image/ImagePixelWidth:distribution/stddev': 0.0, 'image/ImagePixelWidth:distribution/n': 1, 'image/ImagePixelWidth:distribution/max': 256.0, 'image/ImagePixelWidth:distribution/min': 256.0, 'image/ImagePixelWidth:distribution/q_01': 256.0, 'image/ImagePixelWidth:distribution/q_05': 256.0, 'image/ImagePixelWidth:distribution/q_10': 256.0, 'image/ImagePixelWidth:distribution/q_25': 256.0, 'image/ImagePixelWidth:distribution/median': 256.0, 'image/ImagePixelWidth:distribution/q_75': 256.0, 'image/ImagePixelWidth:distribution/q_90': 256.0, 'image/ImagePixelWidth:distribution/q_95': 256.0, 'image/ImagePixelWidth:distribution/q_99': 256.0, 'image/ImagePixelWidth:ints/max': 256, 'image/ImagePixelWidth:ints/min': 256, 'image/ImagePixelWidth:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/ImagePixelHeight:counts/n': 1, 'image/ImagePixelHeight:counts/null': 0, 'image/ImagePixelHeight:types/integral': 1, 'image/ImagePixelHeight:types/fractional': 0, 'image/ImagePixelHeight:types/boolean': 0, 'image/ImagePixelHeight:types/string': 0, 'image/ImagePixelHeight:types/object': 0, 'image/ImagePixelHeight:cardinality/est': 1.0, 'image/ImagePixelHeight:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelHeight:cardinality/lower_1': 1.0, 'image/ImagePixelHeight:distribution/mean': 256.0, 'image/ImagePixelHeight:distribution/stddev': 0.0, 'image/ImagePixelHeight:distribution/n': 1, 'image/ImagePixelHeight:distribution/max': 256.0, 'image/ImagePixelHeight:distribution/min': 256.0, 'image/ImagePixelHeight:distribution/q_01': 256.0, 'image/ImagePixelHeight:distribution/q_05': 256.0, 'image/ImagePixelHeight:distribution/q_10': 256.0, 'image/ImagePixelHeight:distribution/q_25': 256.0, 'image/ImagePixelHeight:distribution/median': 256.0, 'image/ImagePixelHeight:distribution/q_75': 256.0, 'image/ImagePixelHeight:distribution/q_90': 256.0, 'image/ImagePixelHeight:distribution/q_95': 256.0, 'image/ImagePixelHeight:distribution/q_99': 256.0, 'image/ImagePixelHeight:ints/max': 256, 'image/ImagePixelHeight:ints/min': 256, 'image/ImagePixelHeight:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/Colorspace:counts/n': 1, 'image/Colorspace:counts/null': 0, 'image/Colorspace:types/integral': 0, 'image/Colorspace:types/fractional': 0, 'image/Colorspace:types/boolean': 0, 'image/Colorspace:types/string': 1, 'image/Colorspace:types/object': 0, 'image/Colorspace:cardinality/est': 1.0, 'image/Colorspace:cardinality/upper_1': 1.000049929250618, 'image/Colorspace:cardinality/lower_1': 1.0, 'image/Colorspace:frequent_items/frequent_strings': [FrequentItem(value='L', est=1, upper=1, lower=1)], 'image/Hue.mean:counts/n': 1, 'image/Hue.mean:counts/null': 0, 'image/Hue.mean:types/integral': 0, 'image/Hue.mean:types/fractional': 1, 'image/Hue.mean:types/boolean': 0, 'image/Hue.mean:types/string': 0, 'image/Hue.mean:types/object': 0, 'image/Hue.mean:cardinality/est': 1.0, 'image/Hue.mean:cardinality/upper_1': 1.000049929250618, 'image/Hue.mean:cardinality/lower_1': 1.0, 'image/Hue.mean:distribution/mean': 0.0, 'image/Hue.mean:distribution/stddev': 0.0, 'image/Hue.mean:distribution/n': 1, 'image/Hue.mean:distribution/max': 0.0, 'image/Hue.mean:distribution/min': 0.0, 'image/Hue.mean:distribution/q_01': 0.0, 'image/Hue.mean:distribution/q_05': 0.0, 'image/Hue.mean:distribution/q_10': 0.0, 'image/Hue.mean:distribution/q_25': 0.0, 'image/Hue.mean:distribution/median': 0.0, 'image/Hue.mean:distribution/q_75': 0.0, 'image/Hue.mean:distribution/q_90': 0.0, 'image/Hue.mean:distribution/q_95': 0.0, 'image/Hue.mean:distribution/q_99': 0.0, 'image/Hue.stddev:counts/n': 1, 'image/Hue.stddev:counts/null': 0, 'image/Hue.stddev:types/integral': 0, 'image/Hue.stddev:types/fractional': 1, 'image/Hue.stddev:types/boolean': 0, 'image/Hue.stddev:types/string': 0, 'image/Hue.stddev:types/object': 0, 'image/Hue.stddev:cardinality/est': 1.0, 'image/Hue.stddev:cardinality/upper_1': 1.000049929250618, 'image/Hue.stddev:cardinality/lower_1': 1.0, 'image/Hue.stddev:distribution/mean': 0.0, 'image/Hue.stddev:distribution/stddev': 0.0, 'image/Hue.stddev:distribution/n': 1, 'image/Hue.stddev:distribution/max': 0.0, 'image/Hue.stddev:distribution/min': 0.0, 'image/Hue.stddev:distribution/q_01': 0.0, 'image/Hue.stddev:distribution/q_05': 0.0, 'image/Hue.stddev:distribution/q_10': 0.0, 'image/Hue.stddev:distribution/q_25': 0.0, 'image/Hue.stddev:distribution/median': 0.0, 'image/Hue.stddev:distribution/q_75': 0.0, 'image/Hue.stddev:distribution/q_90': 0.0, 'image/Hue.stddev:distribution/q_95': 0.0, 'image/Hue.stddev:distribution/q_99': 0.0, 'image/Saturation.mean:counts/n': 1, 'image/Saturation.mean:counts/null': 0, 'image/Saturation.mean:types/integral': 0, 'image/Saturation.mean:types/fractional': 1, 'image/Saturation.mean:types/boolean': 0, 'image/Saturation.mean:types/string': 0, 'image/Saturation.mean:types/object': 0, 'image/Saturation.mean:cardinality/est': 1.0, 'image/Saturation.mean:cardinality/upper_1': 1.000049929250618, 'image/Saturation.mean:cardinality/lower_1': 1.0, 'image/Saturation.mean:distribution/mean': 0.0, 'image/Saturation.mean:distribution/stddev': 0.0, 'image/Saturation.mean:distribution/n': 1, 'image/Saturation.mean:distribution/max': 0.0, 'image/Saturation.mean:distribution/min': 0.0, 'image/Saturation.mean:distribution/q_01': 0.0, 'image/Saturation.mean:distribution/q_05': 0.0, 'image/Saturation.mean:distribution/q_10': 0.0, 'image/Saturation.mean:distribution/q_25': 0.0, 'image/Saturation.mean:distribution/median': 0.0, 'image/Saturation.mean:distribution/q_75': 0.0, 'image/Saturation.mean:distribution/q_90': 0.0, 'image/Saturation.mean:distribution/q_95': 0.0, 'image/Saturation.mean:distribution/q_99': 0.0, 'image/Saturation.stddev:counts/n': 1, 'image/Saturation.stddev:counts/null': 0, 'image/Saturation.stddev:types/integral': 0, 'image/Saturation.stddev:types/fractional': 1, 'image/Saturation.stddev:types/boolean': 0, 'image/Saturation.stddev:types/string': 0, 'image/Saturation.stddev:types/object': 0, 'image/Saturation.stddev:cardinality/est': 1.0, 'image/Saturation.stddev:cardinality/upper_1': 1.000049929250618, 'image/Saturation.stddev:cardinality/lower_1': 1.0, 'image/Saturation.stddev:distribution/mean': 0.0, 'image/Saturation.stddev:distribution/stddev': 0.0, 'image/Saturation.stddev:distribution/n': 1, 'image/Saturation.stddev:distribution/max': 0.0, 'image/Saturation.stddev:distribution/min': 0.0, 'image/Saturation.stddev:distribution/q_01': 0.0, 'image/Saturation.stddev:distribution/q_05': 0.0, 'image/Saturation.stddev:distribution/q_10': 0.0, 'image/Saturation.stddev:distribution/q_25': 0.0, 'image/Saturation.stddev:distribution/median': 0.0, 'image/Saturation.stddev:distribution/q_75': 0.0, 'image/Saturation.stddev:distribution/q_90': 0.0, 'image/Saturation.stddev:distribution/q_95': 0.0, 'image/Saturation.stddev:distribution/q_99': 0.0, 'image/Brightness.mean:counts/n': 1, 'image/Brightness.mean:counts/null': 0, 'image/Brightness.mean:types/integral': 0, 'image/Brightness.mean:types/fractional': 1, 'image/Brightness.mean:types/boolean': 0, 'image/Brightness.mean:types/string': 0, 'image/Brightness.mean:types/object': 0, 'image/Brightness.mean:cardinality/est': 1.0, 'image/Brightness.mean:cardinality/upper_1': 1.000049929250618, 'image/Brightness.mean:cardinality/lower_1': 1.0, 'image/Brightness.mean:distribution/mean': 44.64898681640625, 'image/Brightness.mean:distribution/stddev': 0.0, 'image/Brightness.mean:distribution/n': 1, 'image/Brightness.mean:distribution/max': 44.64898681640625, 'image/Brightness.mean:distribution/min': 44.64898681640625, 'image/Brightness.mean:distribution/q_01': 44.64898681640625, 'image/Brightness.mean:distribution/q_05': 44.64898681640625, 'image/Brightness.mean:distribution/q_10': 44.64898681640625, 'image/Brightness.mean:distribution/q_25': 44.64898681640625, 'image/Brightness.mean:distribution/median': 44.64898681640625, 'image/Brightness.mean:distribution/q_75': 44.64898681640625, 'image/Brightness.mean:distribution/q_90': 44.64898681640625, 'image/Brightness.mean:distribution/q_95': 44.64898681640625, 'image/Brightness.mean:distribution/q_99': 44.64898681640625, 'image/Brightness.stddev:counts/n': 1, 'image/Brightness.stddev:counts/null': 0, 'image/Brightness.stddev:types/integral': 0, 'image/Brightness.stddev:types/fractional': 1, 'image/Brightness.stddev:types/boolean': 0, 'image/Brightness.stddev:types/string': 0, 'image/Brightness.stddev:types/object': 0, 'image/Brightness.stddev:cardinality/est': 1.0, 'image/Brightness.stddev:cardinality/upper_1': 1.000049929250618, 'image/Brightness.stddev:cardinality/lower_1': 1.0, 'image/Brightness.stddev:distribution/mean': 25.79447615661466, 'image/Brightness.stddev:distribution/stddev': 0.0, 'image/Brightness.stddev:distribution/n': 1, 'image/Brightness.stddev:distribution/max': 25.79447615661466, 'image/Brightness.stddev:distribution/min': 25.79447615661466, 'image/Brightness.stddev:distribution/q_01': 25.79447615661466, 'image/Brightness.stddev:distribution/q_05': 25.79447615661466, 'image/Brightness.stddev:distribution/q_10': 25.79447615661466, 'image/Brightness.stddev:distribution/q_25': 25.79447615661466, 'image/Brightness.stddev:distribution/median': 25.79447615661466, 'image/Brightness.stddev:distribution/q_75': 25.79447615661466, 'image/Brightness.stddev:distribution/q_90': 25.79447615661466, 'image/Brightness.stddev:distribution/q_95': 25.79447615661466, 'image/Brightness.stddev:distribution/q_99': 25.79447615661466}
You can change the default name if you like:
results = log_image([img1, img2], default_column_prefix="awesome_image")
print(list(results.view().get_columns()))
print(results.view().get_column("awesome_image_0").to_summary_dict())
['awesome_image_0', 'awesome_image_1'] {'image/ImagePixelWidth:counts/n': 1, 'image/ImagePixelWidth:counts/null': 0, 'image/ImagePixelWidth:types/integral': 1, 'image/ImagePixelWidth:types/fractional': 0, 'image/ImagePixelWidth:types/boolean': 0, 'image/ImagePixelWidth:types/string': 0, 'image/ImagePixelWidth:types/object': 0, 'image/ImagePixelWidth:cardinality/est': 1.0, 'image/ImagePixelWidth:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelWidth:cardinality/lower_1': 1.0, 'image/ImagePixelWidth:distribution/mean': 256.0, 'image/ImagePixelWidth:distribution/stddev': 0.0, 'image/ImagePixelWidth:distribution/n': 1, 'image/ImagePixelWidth:distribution/max': 256.0, 'image/ImagePixelWidth:distribution/min': 256.0, 'image/ImagePixelWidth:distribution/q_01': 256.0, 'image/ImagePixelWidth:distribution/q_05': 256.0, 'image/ImagePixelWidth:distribution/q_10': 256.0, 'image/ImagePixelWidth:distribution/q_25': 256.0, 'image/ImagePixelWidth:distribution/median': 256.0, 'image/ImagePixelWidth:distribution/q_75': 256.0, 'image/ImagePixelWidth:distribution/q_90': 256.0, 'image/ImagePixelWidth:distribution/q_95': 256.0, 'image/ImagePixelWidth:distribution/q_99': 256.0, 'image/ImagePixelWidth:ints/max': 256, 'image/ImagePixelWidth:ints/min': 256, 'image/ImagePixelWidth:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/ImagePixelHeight:counts/n': 1, 'image/ImagePixelHeight:counts/null': 0, 'image/ImagePixelHeight:types/integral': 1, 'image/ImagePixelHeight:types/fractional': 0, 'image/ImagePixelHeight:types/boolean': 0, 'image/ImagePixelHeight:types/string': 0, 'image/ImagePixelHeight:types/object': 0, 'image/ImagePixelHeight:cardinality/est': 1.0, 'image/ImagePixelHeight:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelHeight:cardinality/lower_1': 1.0, 'image/ImagePixelHeight:distribution/mean': 256.0, 'image/ImagePixelHeight:distribution/stddev': 0.0, 'image/ImagePixelHeight:distribution/n': 1, 'image/ImagePixelHeight:distribution/max': 256.0, 'image/ImagePixelHeight:distribution/min': 256.0, 'image/ImagePixelHeight:distribution/q_01': 256.0, 'image/ImagePixelHeight:distribution/q_05': 256.0, 'image/ImagePixelHeight:distribution/q_10': 256.0, 'image/ImagePixelHeight:distribution/q_25': 256.0, 'image/ImagePixelHeight:distribution/median': 256.0, 'image/ImagePixelHeight:distribution/q_75': 256.0, 'image/ImagePixelHeight:distribution/q_90': 256.0, 'image/ImagePixelHeight:distribution/q_95': 256.0, 'image/ImagePixelHeight:distribution/q_99': 256.0, 'image/ImagePixelHeight:ints/max': 256, 'image/ImagePixelHeight:ints/min': 256, 'image/ImagePixelHeight:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/Colorspace:counts/n': 1, 'image/Colorspace:counts/null': 0, 'image/Colorspace:types/integral': 0, 'image/Colorspace:types/fractional': 0, 'image/Colorspace:types/boolean': 0, 'image/Colorspace:types/string': 1, 'image/Colorspace:types/object': 0, 'image/Colorspace:cardinality/est': 1.0, 'image/Colorspace:cardinality/upper_1': 1.000049929250618, 'image/Colorspace:cardinality/lower_1': 1.0, 'image/Colorspace:frequent_items/frequent_strings': [FrequentItem(value='L', est=1, upper=1, lower=1)], 'image/Hue.mean:counts/n': 1, 'image/Hue.mean:counts/null': 0, 'image/Hue.mean:types/integral': 0, 'image/Hue.mean:types/fractional': 1, 'image/Hue.mean:types/boolean': 0, 'image/Hue.mean:types/string': 0, 'image/Hue.mean:types/object': 0, 'image/Hue.mean:cardinality/est': 1.0, 'image/Hue.mean:cardinality/upper_1': 1.000049929250618, 'image/Hue.mean:cardinality/lower_1': 1.0, 'image/Hue.mean:distribution/mean': 0.0, 'image/Hue.mean:distribution/stddev': 0.0, 'image/Hue.mean:distribution/n': 1, 'image/Hue.mean:distribution/max': 0.0, 'image/Hue.mean:distribution/min': 0.0, 'image/Hue.mean:distribution/q_01': 0.0, 'image/Hue.mean:distribution/q_05': 0.0, 'image/Hue.mean:distribution/q_10': 0.0, 'image/Hue.mean:distribution/q_25': 0.0, 'image/Hue.mean:distribution/median': 0.0, 'image/Hue.mean:distribution/q_75': 0.0, 'image/Hue.mean:distribution/q_90': 0.0, 'image/Hue.mean:distribution/q_95': 0.0, 'image/Hue.mean:distribution/q_99': 0.0, 'image/Hue.stddev:counts/n': 1, 'image/Hue.stddev:counts/null': 0, 'image/Hue.stddev:types/integral': 0, 'image/Hue.stddev:types/fractional': 1, 'image/Hue.stddev:types/boolean': 0, 'image/Hue.stddev:types/string': 0, 'image/Hue.stddev:types/object': 0, 'image/Hue.stddev:cardinality/est': 1.0, 'image/Hue.stddev:cardinality/upper_1': 1.000049929250618, 'image/Hue.stddev:cardinality/lower_1': 1.0, 'image/Hue.stddev:distribution/mean': 0.0, 'image/Hue.stddev:distribution/stddev': 0.0, 'image/Hue.stddev:distribution/n': 1, 'image/Hue.stddev:distribution/max': 0.0, 'image/Hue.stddev:distribution/min': 0.0, 'image/Hue.stddev:distribution/q_01': 0.0, 'image/Hue.stddev:distribution/q_05': 0.0, 'image/Hue.stddev:distribution/q_10': 0.0, 'image/Hue.stddev:distribution/q_25': 0.0, 'image/Hue.stddev:distribution/median': 0.0, 'image/Hue.stddev:distribution/q_75': 0.0, 'image/Hue.stddev:distribution/q_90': 0.0, 'image/Hue.stddev:distribution/q_95': 0.0, 'image/Hue.stddev:distribution/q_99': 0.0, 'image/Saturation.mean:counts/n': 1, 'image/Saturation.mean:counts/null': 0, 'image/Saturation.mean:types/integral': 0, 'image/Saturation.mean:types/fractional': 1, 'image/Saturation.mean:types/boolean': 0, 'image/Saturation.mean:types/string': 0, 'image/Saturation.mean:types/object': 0, 'image/Saturation.mean:cardinality/est': 1.0, 'image/Saturation.mean:cardinality/upper_1': 1.000049929250618, 'image/Saturation.mean:cardinality/lower_1': 1.0, 'image/Saturation.mean:distribution/mean': 0.0, 'image/Saturation.mean:distribution/stddev': 0.0, 'image/Saturation.mean:distribution/n': 1, 'image/Saturation.mean:distribution/max': 0.0, 'image/Saturation.mean:distribution/min': 0.0, 'image/Saturation.mean:distribution/q_01': 0.0, 'image/Saturation.mean:distribution/q_05': 0.0, 'image/Saturation.mean:distribution/q_10': 0.0, 'image/Saturation.mean:distribution/q_25': 0.0, 'image/Saturation.mean:distribution/median': 0.0, 'image/Saturation.mean:distribution/q_75': 0.0, 'image/Saturation.mean:distribution/q_90': 0.0, 'image/Saturation.mean:distribution/q_95': 0.0, 'image/Saturation.mean:distribution/q_99': 0.0, 'image/Saturation.stddev:counts/n': 1, 'image/Saturation.stddev:counts/null': 0, 'image/Saturation.stddev:types/integral': 0, 'image/Saturation.stddev:types/fractional': 1, 'image/Saturation.stddev:types/boolean': 0, 'image/Saturation.stddev:types/string': 0, 'image/Saturation.stddev:types/object': 0, 'image/Saturation.stddev:cardinality/est': 1.0, 'image/Saturation.stddev:cardinality/upper_1': 1.000049929250618, 'image/Saturation.stddev:cardinality/lower_1': 1.0, 'image/Saturation.stddev:distribution/mean': 0.0, 'image/Saturation.stddev:distribution/stddev': 0.0, 'image/Saturation.stddev:distribution/n': 1, 'image/Saturation.stddev:distribution/max': 0.0, 'image/Saturation.stddev:distribution/min': 0.0, 'image/Saturation.stddev:distribution/q_01': 0.0, 'image/Saturation.stddev:distribution/q_05': 0.0, 'image/Saturation.stddev:distribution/q_10': 0.0, 'image/Saturation.stddev:distribution/q_25': 0.0, 'image/Saturation.stddev:distribution/median': 0.0, 'image/Saturation.stddev:distribution/q_75': 0.0, 'image/Saturation.stddev:distribution/q_90': 0.0, 'image/Saturation.stddev:distribution/q_95': 0.0, 'image/Saturation.stddev:distribution/q_99': 0.0, 'image/Brightness.mean:counts/n': 1, 'image/Brightness.mean:counts/null': 0, 'image/Brightness.mean:types/integral': 0, 'image/Brightness.mean:types/fractional': 1, 'image/Brightness.mean:types/boolean': 0, 'image/Brightness.mean:types/string': 0, 'image/Brightness.mean:types/object': 0, 'image/Brightness.mean:cardinality/est': 1.0, 'image/Brightness.mean:cardinality/upper_1': 1.000049929250618, 'image/Brightness.mean:cardinality/lower_1': 1.0, 'image/Brightness.mean:distribution/mean': 91.99722290039062, 'image/Brightness.mean:distribution/stddev': 0.0, 'image/Brightness.mean:distribution/n': 1, 'image/Brightness.mean:distribution/max': 91.99722290039062, 'image/Brightness.mean:distribution/min': 91.99722290039062, 'image/Brightness.mean:distribution/q_01': 91.99722290039062, 'image/Brightness.mean:distribution/q_05': 91.99722290039062, 'image/Brightness.mean:distribution/q_10': 91.99722290039062, 'image/Brightness.mean:distribution/q_25': 91.99722290039062, 'image/Brightness.mean:distribution/median': 91.99722290039062, 'image/Brightness.mean:distribution/q_75': 91.99722290039062, 'image/Brightness.mean:distribution/q_90': 91.99722290039062, 'image/Brightness.mean:distribution/q_95': 91.99722290039062, 'image/Brightness.mean:distribution/q_99': 91.99722290039062, 'image/Brightness.stddev:counts/n': 1, 'image/Brightness.stddev:counts/null': 0, 'image/Brightness.stddev:types/integral': 0, 'image/Brightness.stddev:types/fractional': 1, 'image/Brightness.stddev:types/boolean': 0, 'image/Brightness.stddev:types/string': 0, 'image/Brightness.stddev:types/object': 0, 'image/Brightness.stddev:cardinality/est': 1.0, 'image/Brightness.stddev:cardinality/upper_1': 1.000049929250618, 'image/Brightness.stddev:cardinality/lower_1': 1.0, 'image/Brightness.stddev:distribution/mean': 41.904298558131785, 'image/Brightness.stddev:distribution/stddev': 0.0, 'image/Brightness.stddev:distribution/n': 1, 'image/Brightness.stddev:distribution/max': 41.904298558131785, 'image/Brightness.stddev:distribution/min': 41.904298558131785, 'image/Brightness.stddev:distribution/q_01': 41.904298558131785, 'image/Brightness.stddev:distribution/q_05': 41.904298558131785, 'image/Brightness.stddev:distribution/q_10': 41.904298558131785, 'image/Brightness.stddev:distribution/q_25': 41.904298558131785, 'image/Brightness.stddev:distribution/median': 41.904298558131785, 'image/Brightness.stddev:distribution/q_75': 41.904298558131785, 'image/Brightness.stddev:distribution/q_90': 41.904298558131785, 'image/Brightness.stddev:distribution/q_95': 41.904298558131785, 'image/Brightness.stddev:distribution/q_99': 41.904298558131785}
You can also pass a dictionary of images to give each "column" a unique name:
results = log_image({"left_camera": img1, "right_camera": img2})
print(results.view().get_column("right_camera").to_summary_dict())
{'image/ImagePixelWidth:counts/n': 1, 'image/ImagePixelWidth:counts/null': 0, 'image/ImagePixelWidth:types/integral': 1, 'image/ImagePixelWidth:types/fractional': 0, 'image/ImagePixelWidth:types/boolean': 0, 'image/ImagePixelWidth:types/string': 0, 'image/ImagePixelWidth:types/object': 0, 'image/ImagePixelWidth:cardinality/est': 1.0, 'image/ImagePixelWidth:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelWidth:cardinality/lower_1': 1.0, 'image/ImagePixelWidth:distribution/mean': 256.0, 'image/ImagePixelWidth:distribution/stddev': 0.0, 'image/ImagePixelWidth:distribution/n': 1, 'image/ImagePixelWidth:distribution/max': 256.0, 'image/ImagePixelWidth:distribution/min': 256.0, 'image/ImagePixelWidth:distribution/q_01': 256.0, 'image/ImagePixelWidth:distribution/q_05': 256.0, 'image/ImagePixelWidth:distribution/q_10': 256.0, 'image/ImagePixelWidth:distribution/q_25': 256.0, 'image/ImagePixelWidth:distribution/median': 256.0, 'image/ImagePixelWidth:distribution/q_75': 256.0, 'image/ImagePixelWidth:distribution/q_90': 256.0, 'image/ImagePixelWidth:distribution/q_95': 256.0, 'image/ImagePixelWidth:distribution/q_99': 256.0, 'image/ImagePixelWidth:ints/max': 256, 'image/ImagePixelWidth:ints/min': 256, 'image/ImagePixelWidth:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/ImagePixelHeight:counts/n': 1, 'image/ImagePixelHeight:counts/null': 0, 'image/ImagePixelHeight:types/integral': 1, 'image/ImagePixelHeight:types/fractional': 0, 'image/ImagePixelHeight:types/boolean': 0, 'image/ImagePixelHeight:types/string': 0, 'image/ImagePixelHeight:types/object': 0, 'image/ImagePixelHeight:cardinality/est': 1.0, 'image/ImagePixelHeight:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelHeight:cardinality/lower_1': 1.0, 'image/ImagePixelHeight:distribution/mean': 256.0, 'image/ImagePixelHeight:distribution/stddev': 0.0, 'image/ImagePixelHeight:distribution/n': 1, 'image/ImagePixelHeight:distribution/max': 256.0, 'image/ImagePixelHeight:distribution/min': 256.0, 'image/ImagePixelHeight:distribution/q_01': 256.0, 'image/ImagePixelHeight:distribution/q_05': 256.0, 'image/ImagePixelHeight:distribution/q_10': 256.0, 'image/ImagePixelHeight:distribution/q_25': 256.0, 'image/ImagePixelHeight:distribution/median': 256.0, 'image/ImagePixelHeight:distribution/q_75': 256.0, 'image/ImagePixelHeight:distribution/q_90': 256.0, 'image/ImagePixelHeight:distribution/q_95': 256.0, 'image/ImagePixelHeight:distribution/q_99': 256.0, 'image/ImagePixelHeight:ints/max': 256, 'image/ImagePixelHeight:ints/min': 256, 'image/ImagePixelHeight:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/Colorspace:counts/n': 1, 'image/Colorspace:counts/null': 0, 'image/Colorspace:types/integral': 0, 'image/Colorspace:types/fractional': 0, 'image/Colorspace:types/boolean': 0, 'image/Colorspace:types/string': 1, 'image/Colorspace:types/object': 0, 'image/Colorspace:cardinality/est': 1.0, 'image/Colorspace:cardinality/upper_1': 1.000049929250618, 'image/Colorspace:cardinality/lower_1': 1.0, 'image/Colorspace:frequent_items/frequent_strings': [FrequentItem(value='L', est=1, upper=1, lower=1)], 'image/Hue.mean:counts/n': 1, 'image/Hue.mean:counts/null': 0, 'image/Hue.mean:types/integral': 0, 'image/Hue.mean:types/fractional': 1, 'image/Hue.mean:types/boolean': 0, 'image/Hue.mean:types/string': 0, 'image/Hue.mean:types/object': 0, 'image/Hue.mean:cardinality/est': 1.0, 'image/Hue.mean:cardinality/upper_1': 1.000049929250618, 'image/Hue.mean:cardinality/lower_1': 1.0, 'image/Hue.mean:distribution/mean': 0.0, 'image/Hue.mean:distribution/stddev': 0.0, 'image/Hue.mean:distribution/n': 1, 'image/Hue.mean:distribution/max': 0.0, 'image/Hue.mean:distribution/min': 0.0, 'image/Hue.mean:distribution/q_01': 0.0, 'image/Hue.mean:distribution/q_05': 0.0, 'image/Hue.mean:distribution/q_10': 0.0, 'image/Hue.mean:distribution/q_25': 0.0, 'image/Hue.mean:distribution/median': 0.0, 'image/Hue.mean:distribution/q_75': 0.0, 'image/Hue.mean:distribution/q_90': 0.0, 'image/Hue.mean:distribution/q_95': 0.0, 'image/Hue.mean:distribution/q_99': 0.0, 'image/Hue.stddev:counts/n': 1, 'image/Hue.stddev:counts/null': 0, 'image/Hue.stddev:types/integral': 0, 'image/Hue.stddev:types/fractional': 1, 'image/Hue.stddev:types/boolean': 0, 'image/Hue.stddev:types/string': 0, 'image/Hue.stddev:types/object': 0, 'image/Hue.stddev:cardinality/est': 1.0, 'image/Hue.stddev:cardinality/upper_1': 1.000049929250618, 'image/Hue.stddev:cardinality/lower_1': 1.0, 'image/Hue.stddev:distribution/mean': 0.0, 'image/Hue.stddev:distribution/stddev': 0.0, 'image/Hue.stddev:distribution/n': 1, 'image/Hue.stddev:distribution/max': 0.0, 'image/Hue.stddev:distribution/min': 0.0, 'image/Hue.stddev:distribution/q_01': 0.0, 'image/Hue.stddev:distribution/q_05': 0.0, 'image/Hue.stddev:distribution/q_10': 0.0, 'image/Hue.stddev:distribution/q_25': 0.0, 'image/Hue.stddev:distribution/median': 0.0, 'image/Hue.stddev:distribution/q_75': 0.0, 'image/Hue.stddev:distribution/q_90': 0.0, 'image/Hue.stddev:distribution/q_95': 0.0, 'image/Hue.stddev:distribution/q_99': 0.0, 'image/Saturation.mean:counts/n': 1, 'image/Saturation.mean:counts/null': 0, 'image/Saturation.mean:types/integral': 0, 'image/Saturation.mean:types/fractional': 1, 'image/Saturation.mean:types/boolean': 0, 'image/Saturation.mean:types/string': 0, 'image/Saturation.mean:types/object': 0, 'image/Saturation.mean:cardinality/est': 1.0, 'image/Saturation.mean:cardinality/upper_1': 1.000049929250618, 'image/Saturation.mean:cardinality/lower_1': 1.0, 'image/Saturation.mean:distribution/mean': 0.0, 'image/Saturation.mean:distribution/stddev': 0.0, 'image/Saturation.mean:distribution/n': 1, 'image/Saturation.mean:distribution/max': 0.0, 'image/Saturation.mean:distribution/min': 0.0, 'image/Saturation.mean:distribution/q_01': 0.0, 'image/Saturation.mean:distribution/q_05': 0.0, 'image/Saturation.mean:distribution/q_10': 0.0, 'image/Saturation.mean:distribution/q_25': 0.0, 'image/Saturation.mean:distribution/median': 0.0, 'image/Saturation.mean:distribution/q_75': 0.0, 'image/Saturation.mean:distribution/q_90': 0.0, 'image/Saturation.mean:distribution/q_95': 0.0, 'image/Saturation.mean:distribution/q_99': 0.0, 'image/Saturation.stddev:counts/n': 1, 'image/Saturation.stddev:counts/null': 0, 'image/Saturation.stddev:types/integral': 0, 'image/Saturation.stddev:types/fractional': 1, 'image/Saturation.stddev:types/boolean': 0, 'image/Saturation.stddev:types/string': 0, 'image/Saturation.stddev:types/object': 0, 'image/Saturation.stddev:cardinality/est': 1.0, 'image/Saturation.stddev:cardinality/upper_1': 1.000049929250618, 'image/Saturation.stddev:cardinality/lower_1': 1.0, 'image/Saturation.stddev:distribution/mean': 0.0, 'image/Saturation.stddev:distribution/stddev': 0.0, 'image/Saturation.stddev:distribution/n': 1, 'image/Saturation.stddev:distribution/max': 0.0, 'image/Saturation.stddev:distribution/min': 0.0, 'image/Saturation.stddev:distribution/q_01': 0.0, 'image/Saturation.stddev:distribution/q_05': 0.0, 'image/Saturation.stddev:distribution/q_10': 0.0, 'image/Saturation.stddev:distribution/q_25': 0.0, 'image/Saturation.stddev:distribution/median': 0.0, 'image/Saturation.stddev:distribution/q_75': 0.0, 'image/Saturation.stddev:distribution/q_90': 0.0, 'image/Saturation.stddev:distribution/q_95': 0.0, 'image/Saturation.stddev:distribution/q_99': 0.0, 'image/Brightness.mean:counts/n': 1, 'image/Brightness.mean:counts/null': 0, 'image/Brightness.mean:types/integral': 0, 'image/Brightness.mean:types/fractional': 1, 'image/Brightness.mean:types/boolean': 0, 'image/Brightness.mean:types/string': 0, 'image/Brightness.mean:types/object': 0, 'image/Brightness.mean:cardinality/est': 1.0, 'image/Brightness.mean:cardinality/upper_1': 1.000049929250618, 'image/Brightness.mean:cardinality/lower_1': 1.0, 'image/Brightness.mean:distribution/mean': 44.64898681640625, 'image/Brightness.mean:distribution/stddev': 0.0, 'image/Brightness.mean:distribution/n': 1, 'image/Brightness.mean:distribution/max': 44.64898681640625, 'image/Brightness.mean:distribution/min': 44.64898681640625, 'image/Brightness.mean:distribution/q_01': 44.64898681640625, 'image/Brightness.mean:distribution/q_05': 44.64898681640625, 'image/Brightness.mean:distribution/q_10': 44.64898681640625, 'image/Brightness.mean:distribution/q_25': 44.64898681640625, 'image/Brightness.mean:distribution/median': 44.64898681640625, 'image/Brightness.mean:distribution/q_75': 44.64898681640625, 'image/Brightness.mean:distribution/q_90': 44.64898681640625, 'image/Brightness.mean:distribution/q_95': 44.64898681640625, 'image/Brightness.mean:distribution/q_99': 44.64898681640625, 'image/Brightness.stddev:counts/n': 1, 'image/Brightness.stddev:counts/null': 0, 'image/Brightness.stddev:types/integral': 0, 'image/Brightness.stddev:types/fractional': 1, 'image/Brightness.stddev:types/boolean': 0, 'image/Brightness.stddev:types/string': 0, 'image/Brightness.stddev:types/object': 0, 'image/Brightness.stddev:cardinality/est': 1.0, 'image/Brightness.stddev:cardinality/upper_1': 1.000049929250618, 'image/Brightness.stddev:cardinality/lower_1': 1.0, 'image/Brightness.stddev:distribution/mean': 25.79447615661466, 'image/Brightness.stddev:distribution/stddev': 0.0, 'image/Brightness.stddev:distribution/n': 1, 'image/Brightness.stddev:distribution/max': 25.79447615661466, 'image/Brightness.stddev:distribution/min': 25.79447615661466, 'image/Brightness.stddev:distribution/q_01': 25.79447615661466, 'image/Brightness.stddev:distribution/q_05': 25.79447615661466, 'image/Brightness.stddev:distribution/q_10': 25.79447615661466, 'image/Brightness.stddev:distribution/q_25': 25.79447615661466, 'image/Brightness.stddev:distribution/median': 25.79447615661466, 'image/Brightness.stddev:distribution/q_75': 25.79447615661466, 'image/Brightness.stddev:distribution/q_90': 25.79447615661466, 'image/Brightness.stddev:distribution/q_95': 25.79447615661466, 'image/Brightness.stddev:distribution/q_99': 25.79447615661466}
whylogs will include any EXIF tags with numeric or string values in the image profile. PIL's EXIF facilities are rudimentary, so we'll use the piexif library to construct EXIF tags for this example. See the Advanced Image Logging section for how to control which EXIF tags are tracked.
%pip install piexif
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Collecting piexif Downloading piexif-1.1.3-py2.py3-none-any.whl (20 kB) Installing collected packages: piexif Successfully installed piexif-1.1.3
import piexif
zeroth_ifd = {
piexif.ImageIFD.Artist: u"someone",
piexif.ImageIFD.XResolution: (96, 1),
piexif.ImageIFD.YResolution: (96, 1),
piexif.ImageIFD.Software: u"piexif"
}
exif_ifd = {
piexif.ExifIFD.DateTimeOriginal: u"2099:09:29 10:10:10",
piexif.ExifIFD.LensMake: u"LensMake",
piexif.ExifIFD.Sharpness: 65535,
piexif.ExifIFD.LensSpecification: ((1, 1), (1, 1), (1, 1), (1, 1)),
}
exif_dict = {"0th": zeroth_ifd, "Exif": exif_ifd}
exif_bytes = piexif.dump(exif_dict)
img2.save("out.jpg", exif=exif_bytes)
img3 = Image.open("out.jpg")
print(img3._getexif())
results = log_image(img3)
print(results.view().get_column("image").to_summary_dict())
{36867: '2099:09:29 10:10:10', 41994: 65535, 282: (96, 1), 283: (96, 1), 34665: 105, 305: 'piexif', 42034: ((1, 1), (1, 1), (1, 1), (1, 1)), 42035: 'LensMake', 315: 'someone'} {'image/DateTimeOriginal:counts/n': 1, 'image/DateTimeOriginal:counts/null': 0, 'image/DateTimeOriginal:types/integral': 0, 'image/DateTimeOriginal:types/fractional': 0, 'image/DateTimeOriginal:types/boolean': 0, 'image/DateTimeOriginal:types/string': 1, 'image/DateTimeOriginal:types/object': 0, 'image/DateTimeOriginal:cardinality/est': 1.0, 'image/DateTimeOriginal:cardinality/upper_1': 1.000049929250618, 'image/DateTimeOriginal:cardinality/lower_1': 1.0, 'image/DateTimeOriginal:frequent_items/frequent_strings': [FrequentItem(value='2099:09:29 10:10:10', est=1, upper=1, lower=1)], 'image/ExifIFD:counts/n': 1, 'image/ExifIFD:counts/null': 0, 'image/ExifIFD:types/integral': 1, 'image/ExifIFD:types/fractional': 0, 'image/ExifIFD:types/boolean': 0, 'image/ExifIFD:types/string': 0, 'image/ExifIFD:types/object': 0, 'image/ExifIFD:cardinality/est': 1.0, 'image/ExifIFD:cardinality/upper_1': 1.000049929250618, 'image/ExifIFD:cardinality/lower_1': 1.0, 'image/ExifIFD:distribution/mean': 105.0, 'image/ExifIFD:distribution/stddev': 0.0, 'image/ExifIFD:distribution/n': 1, 'image/ExifIFD:distribution/max': 105.0, 'image/ExifIFD:distribution/min': 105.0, 'image/ExifIFD:distribution/q_01': 105.0, 'image/ExifIFD:distribution/q_05': 105.0, 'image/ExifIFD:distribution/q_10': 105.0, 'image/ExifIFD:distribution/q_25': 105.0, 'image/ExifIFD:distribution/median': 105.0, 'image/ExifIFD:distribution/q_75': 105.0, 'image/ExifIFD:distribution/q_90': 105.0, 'image/ExifIFD:distribution/q_95': 105.0, 'image/ExifIFD:distribution/q_99': 105.0, 'image/ExifIFD:ints/max': 105, 'image/ExifIFD:ints/min': 105, 'image/ExifIFD:frequent_items/frequent_strings': [FrequentItem(value='105.000000', est=1, upper=1, lower=1)], 'image/Sharpness:counts/n': 1, 'image/Sharpness:counts/null': 0, 'image/Sharpness:types/integral': 1, 'image/Sharpness:types/fractional': 0, 'image/Sharpness:types/boolean': 0, 'image/Sharpness:types/string': 0, 'image/Sharpness:types/object': 0, 'image/Sharpness:cardinality/est': 1.0, 'image/Sharpness:cardinality/upper_1': 1.000049929250618, 'image/Sharpness:cardinality/lower_1': 1.0, 'image/Sharpness:distribution/mean': 65535.0, 'image/Sharpness:distribution/stddev': 0.0, 'image/Sharpness:distribution/n': 1, 'image/Sharpness:distribution/max': 65535.0, 'image/Sharpness:distribution/min': 65535.0, 'image/Sharpness:distribution/q_01': 65535.0, 'image/Sharpness:distribution/q_05': 65535.0, 'image/Sharpness:distribution/q_10': 65535.0, 'image/Sharpness:distribution/q_25': 65535.0, 'image/Sharpness:distribution/median': 65535.0, 'image/Sharpness:distribution/q_75': 65535.0, 'image/Sharpness:distribution/q_90': 65535.0, 'image/Sharpness:distribution/q_95': 65535.0, 'image/Sharpness:distribution/q_99': 65535.0, 'image/Sharpness:ints/max': 65535, 'image/Sharpness:ints/min': 65535, 'image/Sharpness:frequent_items/frequent_strings': [FrequentItem(value='65535.000000', est=1, upper=1, lower=1)], 'image/Software:counts/n': 1, 'image/Software:counts/null': 0, 'image/Software:types/integral': 0, 'image/Software:types/fractional': 0, 'image/Software:types/boolean': 0, 'image/Software:types/string': 1, 'image/Software:types/object': 0, 'image/Software:cardinality/est': 1.0, 'image/Software:cardinality/upper_1': 1.000049929250618, 'image/Software:cardinality/lower_1': 1.0, 'image/Software:frequent_items/frequent_strings': [FrequentItem(value='piexif', est=1, upper=1, lower=1)], 'image/LensSpecification:counts/n': 1, 'image/LensSpecification:counts/null': 0, 'image/LensSpecification:types/integral': 0, 'image/LensSpecification:types/fractional': 0, 'image/LensSpecification:types/boolean': 0, 'image/LensSpecification:types/string': 0, 'image/LensSpecification:types/object': 1, 'image/LensSpecification:cardinality/est': 0.0, 'image/LensSpecification:cardinality/upper_1': 0.0, 'image/LensSpecification:cardinality/lower_1': 0.0, 'image/LensMake:counts/n': 1, 'image/LensMake:counts/null': 0, 'image/LensMake:types/integral': 0, 'image/LensMake:types/fractional': 0, 'image/LensMake:types/boolean': 0, 'image/LensMake:types/string': 1, 'image/LensMake:types/object': 0, 'image/LensMake:cardinality/est': 1.0, 'image/LensMake:cardinality/upper_1': 1.000049929250618, 'image/LensMake:cardinality/lower_1': 1.0, 'image/LensMake:frequent_items/frequent_strings': [FrequentItem(value='LensMake', est=1, upper=1, lower=1)], 'image/Artist:counts/n': 1, 'image/Artist:counts/null': 0, 'image/Artist:types/integral': 0, 'image/Artist:types/fractional': 0, 'image/Artist:types/boolean': 0, 'image/Artist:types/string': 1, 'image/Artist:types/object': 0, 'image/Artist:cardinality/est': 1.0, 'image/Artist:cardinality/upper_1': 1.000049929250618, 'image/Artist:cardinality/lower_1': 1.0, 'image/Artist:frequent_items/frequent_strings': [FrequentItem(value='someone', est=1, upper=1, lower=1)], 'image/XResolution:counts/n': 1, 'image/XResolution:counts/null': 0, 'image/XResolution:types/integral': 0, 'image/XResolution:types/fractional': 0, 'image/XResolution:types/boolean': 0, 'image/XResolution:types/string': 0, 'image/XResolution:types/object': 1, 'image/XResolution:cardinality/est': 0.0, 'image/XResolution:cardinality/upper_1': 0.0, 'image/XResolution:cardinality/lower_1': 0.0, 'image/YResolution:counts/n': 1, 'image/YResolution:counts/null': 0, 'image/YResolution:types/integral': 0, 'image/YResolution:types/fractional': 0, 'image/YResolution:types/boolean': 0, 'image/YResolution:types/string': 0, 'image/YResolution:types/object': 1, 'image/YResolution:cardinality/est': 0.0, 'image/YResolution:cardinality/upper_1': 0.0, 'image/YResolution:cardinality/lower_1': 0.0, 'image/ImagePixelWidth:counts/n': 1, 'image/ImagePixelWidth:counts/null': 0, 'image/ImagePixelWidth:types/integral': 1, 'image/ImagePixelWidth:types/fractional': 0, 'image/ImagePixelWidth:types/boolean': 0, 'image/ImagePixelWidth:types/string': 0, 'image/ImagePixelWidth:types/object': 0, 'image/ImagePixelWidth:cardinality/est': 1.0, 'image/ImagePixelWidth:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelWidth:cardinality/lower_1': 1.0, 'image/ImagePixelWidth:distribution/mean': 256.0, 'image/ImagePixelWidth:distribution/stddev': 0.0, 'image/ImagePixelWidth:distribution/n': 1, 'image/ImagePixelWidth:distribution/max': 256.0, 'image/ImagePixelWidth:distribution/min': 256.0, 'image/ImagePixelWidth:distribution/q_01': 256.0, 'image/ImagePixelWidth:distribution/q_05': 256.0, 'image/ImagePixelWidth:distribution/q_10': 256.0, 'image/ImagePixelWidth:distribution/q_25': 256.0, 'image/ImagePixelWidth:distribution/median': 256.0, 'image/ImagePixelWidth:distribution/q_75': 256.0, 'image/ImagePixelWidth:distribution/q_90': 256.0, 'image/ImagePixelWidth:distribution/q_95': 256.0, 'image/ImagePixelWidth:distribution/q_99': 256.0, 'image/ImagePixelWidth:ints/max': 256, 'image/ImagePixelWidth:ints/min': 256, 'image/ImagePixelWidth:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/ImagePixelHeight:counts/n': 1, 'image/ImagePixelHeight:counts/null': 0, 'image/ImagePixelHeight:types/integral': 1, 'image/ImagePixelHeight:types/fractional': 0, 'image/ImagePixelHeight:types/boolean': 0, 'image/ImagePixelHeight:types/string': 0, 'image/ImagePixelHeight:types/object': 0, 'image/ImagePixelHeight:cardinality/est': 1.0, 'image/ImagePixelHeight:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelHeight:cardinality/lower_1': 1.0, 'image/ImagePixelHeight:distribution/mean': 256.0, 'image/ImagePixelHeight:distribution/stddev': 0.0, 'image/ImagePixelHeight:distribution/n': 1, 'image/ImagePixelHeight:distribution/max': 256.0, 'image/ImagePixelHeight:distribution/min': 256.0, 'image/ImagePixelHeight:distribution/q_01': 256.0, 'image/ImagePixelHeight:distribution/q_05': 256.0, 'image/ImagePixelHeight:distribution/q_10': 256.0, 'image/ImagePixelHeight:distribution/q_25': 256.0, 'image/ImagePixelHeight:distribution/median': 256.0, 'image/ImagePixelHeight:distribution/q_75': 256.0, 'image/ImagePixelHeight:distribution/q_90': 256.0, 'image/ImagePixelHeight:distribution/q_95': 256.0, 'image/ImagePixelHeight:distribution/q_99': 256.0, 'image/ImagePixelHeight:ints/max': 256, 'image/ImagePixelHeight:ints/min': 256, 'image/ImagePixelHeight:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/Colorspace:counts/n': 1, 'image/Colorspace:counts/null': 0, 'image/Colorspace:types/integral': 0, 'image/Colorspace:types/fractional': 0, 'image/Colorspace:types/boolean': 0, 'image/Colorspace:types/string': 1, 'image/Colorspace:types/object': 0, 'image/Colorspace:cardinality/est': 1.0, 'image/Colorspace:cardinality/upper_1': 1.000049929250618, 'image/Colorspace:cardinality/lower_1': 1.0, 'image/Colorspace:frequent_items/frequent_strings': [FrequentItem(value='L', est=1, upper=1, lower=1)], 'image/Hue.mean:counts/n': 1, 'image/Hue.mean:counts/null': 0, 'image/Hue.mean:types/integral': 0, 'image/Hue.mean:types/fractional': 1, 'image/Hue.mean:types/boolean': 0, 'image/Hue.mean:types/string': 0, 'image/Hue.mean:types/object': 0, 'image/Hue.mean:cardinality/est': 1.0, 'image/Hue.mean:cardinality/upper_1': 1.000049929250618, 'image/Hue.mean:cardinality/lower_1': 1.0, 'image/Hue.mean:distribution/mean': 0.0, 'image/Hue.mean:distribution/stddev': 0.0, 'image/Hue.mean:distribution/n': 1, 'image/Hue.mean:distribution/max': 0.0, 'image/Hue.mean:distribution/min': 0.0, 'image/Hue.mean:distribution/q_01': 0.0, 'image/Hue.mean:distribution/q_05': 0.0, 'image/Hue.mean:distribution/q_10': 0.0, 'image/Hue.mean:distribution/q_25': 0.0, 'image/Hue.mean:distribution/median': 0.0, 'image/Hue.mean:distribution/q_75': 0.0, 'image/Hue.mean:distribution/q_90': 0.0, 'image/Hue.mean:distribution/q_95': 0.0, 'image/Hue.mean:distribution/q_99': 0.0, 'image/Hue.stddev:counts/n': 1, 'image/Hue.stddev:counts/null': 0, 'image/Hue.stddev:types/integral': 0, 'image/Hue.stddev:types/fractional': 1, 'image/Hue.stddev:types/boolean': 0, 'image/Hue.stddev:types/string': 0, 'image/Hue.stddev:types/object': 0, 'image/Hue.stddev:cardinality/est': 1.0, 'image/Hue.stddev:cardinality/upper_1': 1.000049929250618, 'image/Hue.stddev:cardinality/lower_1': 1.0, 'image/Hue.stddev:distribution/mean': 0.0, 'image/Hue.stddev:distribution/stddev': 0.0, 'image/Hue.stddev:distribution/n': 1, 'image/Hue.stddev:distribution/max': 0.0, 'image/Hue.stddev:distribution/min': 0.0, 'image/Hue.stddev:distribution/q_01': 0.0, 'image/Hue.stddev:distribution/q_05': 0.0, 'image/Hue.stddev:distribution/q_10': 0.0, 'image/Hue.stddev:distribution/q_25': 0.0, 'image/Hue.stddev:distribution/median': 0.0, 'image/Hue.stddev:distribution/q_75': 0.0, 'image/Hue.stddev:distribution/q_90': 0.0, 'image/Hue.stddev:distribution/q_95': 0.0, 'image/Hue.stddev:distribution/q_99': 0.0, 'image/Saturation.mean:counts/n': 1, 'image/Saturation.mean:counts/null': 0, 'image/Saturation.mean:types/integral': 0, 'image/Saturation.mean:types/fractional': 1, 'image/Saturation.mean:types/boolean': 0, 'image/Saturation.mean:types/string': 0, 'image/Saturation.mean:types/object': 0, 'image/Saturation.mean:cardinality/est': 1.0, 'image/Saturation.mean:cardinality/upper_1': 1.000049929250618, 'image/Saturation.mean:cardinality/lower_1': 1.0, 'image/Saturation.mean:distribution/mean': 0.0, 'image/Saturation.mean:distribution/stddev': 0.0, 'image/Saturation.mean:distribution/n': 1, 'image/Saturation.mean:distribution/max': 0.0, 'image/Saturation.mean:distribution/min': 0.0, 'image/Saturation.mean:distribution/q_01': 0.0, 'image/Saturation.mean:distribution/q_05': 0.0, 'image/Saturation.mean:distribution/q_10': 0.0, 'image/Saturation.mean:distribution/q_25': 0.0, 'image/Saturation.mean:distribution/median': 0.0, 'image/Saturation.mean:distribution/q_75': 0.0, 'image/Saturation.mean:distribution/q_90': 0.0, 'image/Saturation.mean:distribution/q_95': 0.0, 'image/Saturation.mean:distribution/q_99': 0.0, 'image/Saturation.stddev:counts/n': 1, 'image/Saturation.stddev:counts/null': 0, 'image/Saturation.stddev:types/integral': 0, 'image/Saturation.stddev:types/fractional': 1, 'image/Saturation.stddev:types/boolean': 0, 'image/Saturation.stddev:types/string': 0, 'image/Saturation.stddev:types/object': 0, 'image/Saturation.stddev:cardinality/est': 1.0, 'image/Saturation.stddev:cardinality/upper_1': 1.000049929250618, 'image/Saturation.stddev:cardinality/lower_1': 1.0, 'image/Saturation.stddev:distribution/mean': 0.0, 'image/Saturation.stddev:distribution/stddev': 0.0, 'image/Saturation.stddev:distribution/n': 1, 'image/Saturation.stddev:distribution/max': 0.0, 'image/Saturation.stddev:distribution/min': 0.0, 'image/Saturation.stddev:distribution/q_01': 0.0, 'image/Saturation.stddev:distribution/q_05': 0.0, 'image/Saturation.stddev:distribution/q_10': 0.0, 'image/Saturation.stddev:distribution/q_25': 0.0, 'image/Saturation.stddev:distribution/median': 0.0, 'image/Saturation.stddev:distribution/q_75': 0.0, 'image/Saturation.stddev:distribution/q_90': 0.0, 'image/Saturation.stddev:distribution/q_95': 0.0, 'image/Saturation.stddev:distribution/q_99': 0.0, 'image/Brightness.mean:counts/n': 1, 'image/Brightness.mean:counts/null': 0, 'image/Brightness.mean:types/integral': 0, 'image/Brightness.mean:types/fractional': 1, 'image/Brightness.mean:types/boolean': 0, 'image/Brightness.mean:types/string': 0, 'image/Brightness.mean:types/object': 0, 'image/Brightness.mean:cardinality/est': 1.0, 'image/Brightness.mean:cardinality/upper_1': 1.000049929250618, 'image/Brightness.mean:cardinality/lower_1': 1.0, 'image/Brightness.mean:distribution/mean': 44.71923828125, 'image/Brightness.mean:distribution/stddev': 0.0, 'image/Brightness.mean:distribution/n': 1, 'image/Brightness.mean:distribution/max': 44.71923828125, 'image/Brightness.mean:distribution/min': 44.71923828125, 'image/Brightness.mean:distribution/q_01': 44.71923828125, 'image/Brightness.mean:distribution/q_05': 44.71923828125, 'image/Brightness.mean:distribution/q_10': 44.71923828125, 'image/Brightness.mean:distribution/q_25': 44.71923828125, 'image/Brightness.mean:distribution/median': 44.71923828125, 'image/Brightness.mean:distribution/q_75': 44.71923828125, 'image/Brightness.mean:distribution/q_90': 44.71923828125, 'image/Brightness.mean:distribution/q_95': 44.71923828125, 'image/Brightness.mean:distribution/q_99': 44.71923828125, 'image/Brightness.stddev:counts/n': 1, 'image/Brightness.stddev:counts/null': 0, 'image/Brightness.stddev:types/integral': 0, 'image/Brightness.stddev:types/fractional': 1, 'image/Brightness.stddev:types/boolean': 0, 'image/Brightness.stddev:types/string': 0, 'image/Brightness.stddev:types/object': 0, 'image/Brightness.stddev:cardinality/est': 1.0, 'image/Brightness.stddev:cardinality/upper_1': 1.000049929250618, 'image/Brightness.stddev:cardinality/lower_1': 1.0, 'image/Brightness.stddev:distribution/mean': 25.719757982712743, 'image/Brightness.stddev:distribution/stddev': 0.0, 'image/Brightness.stddev:distribution/n': 1, 'image/Brightness.stddev:distribution/max': 25.719757982712743, 'image/Brightness.stddev:distribution/min': 25.719757982712743, 'image/Brightness.stddev:distribution/q_01': 25.719757982712743, 'image/Brightness.stddev:distribution/q_05': 25.719757982712743, 'image/Brightness.stddev:distribution/q_10': 25.719757982712743, 'image/Brightness.stddev:distribution/q_25': 25.719757982712743, 'image/Brightness.stddev:distribution/median': 25.719757982712743, 'image/Brightness.stddev:distribution/q_75': 25.719757982712743, 'image/Brightness.stddev:distribution/q_90': 25.719757982712743, 'image/Brightness.stddev:distribution/q_95': 25.719757982712743, 'image/Brightness.stddev:distribution/q_99': 25.719757982712743}
The log_image()
function provides a flexible interface for logging image data. If you want to log images along with other types of data, you can do so by setting up a custom DatasetSchema
to specify which columns contain images. For this example, we'll compute a couple of features from the image and log them along with the image itself in a Pandas DataFrame
. We subclass the StandardResolver
to use an ImageMetric
for any image columns, and the standard metrics for any other columns.
from typing import Dict
from PIL.ImageStat import Stat
import pandas as pd
import whylogs as why
from whylogs.core.datatypes import DataType
from whylogs.core.metrics import Metric
from whylogs.core.resolvers import StandardResolver
from whylogs.core.schema import DatasetSchema, ColumnSchema
from whylogs.extras.image_metric import ImageMetric, ImageMetricConfig
class ImageResolver(StandardResolver):
def resolve(self, name: str, why_type: DataType, column_schema: ColumnSchema) -> Dict[str, Metric]:
if "image" in name:
return {ImageMetric.get_namespace(): ImageMetric.zero(column_schema.cfg)}
return super(ImageResolver, self).resolve(name, why_type, column_schema)
schema = DatasetSchema(resolvers=ImageResolver(), default_configs=ImageMetricConfig())
stats = Stat(img1)
df = pd.DataFrame({"median": stats.median, "sum": stats.sum, "images": img1})
results = why.log(df, schema=schema).view()
print(results.get_column("median").to_summary_dict())
print(results.get_column("sum").to_summary_dict())
print(results.get_column("images").to_summary_dict())
{'counts/n': 1, 'counts/null': 0, 'types/integral': 1, 'types/fractional': 0, 'types/boolean': 0, 'types/string': 0, 'types/object': 0, 'distribution/mean': 85.0, 'distribution/stddev': 0.0, 'distribution/n': 1, 'distribution/max': 85.0, 'distribution/min': 85.0, 'distribution/q_01': 85.0, 'distribution/q_05': 85.0, 'distribution/q_10': 85.0, 'distribution/q_25': 85.0, 'distribution/median': 85.0, 'distribution/q_75': 85.0, 'distribution/q_90': 85.0, 'distribution/q_95': 85.0, 'distribution/q_99': 85.0, 'ints/max': 85, 'ints/min': 85, 'cardinality/est': 1.0, 'cardinality/upper_1': 1.000049929250618, 'cardinality/lower_1': 1.0, 'frequent_items/frequent_strings': [FrequentItem(value='85', est=1, upper=1, lower=1)]} {'counts/n': 1, 'counts/null': 0, 'types/integral': 0, 'types/fractional': 1, 'types/boolean': 0, 'types/string': 0, 'types/object': 0, 'cardinality/est': 1.0, 'cardinality/upper_1': 1.000049929250618, 'cardinality/lower_1': 1.0, 'distribution/mean': 6029130.0, 'distribution/stddev': 0.0, 'distribution/n': 1, 'distribution/max': 6029130.0, 'distribution/min': 6029130.0, 'distribution/q_01': 6029130.0, 'distribution/q_05': 6029130.0, 'distribution/q_10': 6029130.0, 'distribution/q_25': 6029130.0, 'distribution/median': 6029130.0, 'distribution/q_75': 6029130.0, 'distribution/q_90': 6029130.0, 'distribution/q_95': 6029130.0, 'distribution/q_99': 6029130.0} {'image/ImagePixelWidth:counts/n': 1, 'image/ImagePixelWidth:counts/null': 0, 'image/ImagePixelWidth:types/integral': 1, 'image/ImagePixelWidth:types/fractional': 0, 'image/ImagePixelWidth:types/boolean': 0, 'image/ImagePixelWidth:types/string': 0, 'image/ImagePixelWidth:types/object': 0, 'image/ImagePixelWidth:cardinality/est': 1.0, 'image/ImagePixelWidth:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelWidth:cardinality/lower_1': 1.0, 'image/ImagePixelWidth:distribution/mean': 256.0, 'image/ImagePixelWidth:distribution/stddev': 0.0, 'image/ImagePixelWidth:distribution/n': 1, 'image/ImagePixelWidth:distribution/max': 256.0, 'image/ImagePixelWidth:distribution/min': 256.0, 'image/ImagePixelWidth:distribution/q_01': 256.0, 'image/ImagePixelWidth:distribution/q_05': 256.0, 'image/ImagePixelWidth:distribution/q_10': 256.0, 'image/ImagePixelWidth:distribution/q_25': 256.0, 'image/ImagePixelWidth:distribution/median': 256.0, 'image/ImagePixelWidth:distribution/q_75': 256.0, 'image/ImagePixelWidth:distribution/q_90': 256.0, 'image/ImagePixelWidth:distribution/q_95': 256.0, 'image/ImagePixelWidth:distribution/q_99': 256.0, 'image/ImagePixelWidth:ints/max': 256, 'image/ImagePixelWidth:ints/min': 256, 'image/ImagePixelWidth:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/ImagePixelHeight:counts/n': 1, 'image/ImagePixelHeight:counts/null': 0, 'image/ImagePixelHeight:types/integral': 1, 'image/ImagePixelHeight:types/fractional': 0, 'image/ImagePixelHeight:types/boolean': 0, 'image/ImagePixelHeight:types/string': 0, 'image/ImagePixelHeight:types/object': 0, 'image/ImagePixelHeight:cardinality/est': 1.0, 'image/ImagePixelHeight:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelHeight:cardinality/lower_1': 1.0, 'image/ImagePixelHeight:distribution/mean': 256.0, 'image/ImagePixelHeight:distribution/stddev': 0.0, 'image/ImagePixelHeight:distribution/n': 1, 'image/ImagePixelHeight:distribution/max': 256.0, 'image/ImagePixelHeight:distribution/min': 256.0, 'image/ImagePixelHeight:distribution/q_01': 256.0, 'image/ImagePixelHeight:distribution/q_05': 256.0, 'image/ImagePixelHeight:distribution/q_10': 256.0, 'image/ImagePixelHeight:distribution/q_25': 256.0, 'image/ImagePixelHeight:distribution/median': 256.0, 'image/ImagePixelHeight:distribution/q_75': 256.0, 'image/ImagePixelHeight:distribution/q_90': 256.0, 'image/ImagePixelHeight:distribution/q_95': 256.0, 'image/ImagePixelHeight:distribution/q_99': 256.0, 'image/ImagePixelHeight:ints/max': 256, 'image/ImagePixelHeight:ints/min': 256, 'image/ImagePixelHeight:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/Colorspace:counts/n': 1, 'image/Colorspace:counts/null': 0, 'image/Colorspace:types/integral': 0, 'image/Colorspace:types/fractional': 0, 'image/Colorspace:types/boolean': 0, 'image/Colorspace:types/string': 1, 'image/Colorspace:types/object': 0, 'image/Colorspace:cardinality/est': 1.0, 'image/Colorspace:cardinality/upper_1': 1.000049929250618, 'image/Colorspace:cardinality/lower_1': 1.0, 'image/Colorspace:frequent_items/frequent_strings': [FrequentItem(value='L', est=1, upper=1, lower=1)], 'image/Hue.mean:counts/n': 1, 'image/Hue.mean:counts/null': 0, 'image/Hue.mean:types/integral': 0, 'image/Hue.mean:types/fractional': 1, 'image/Hue.mean:types/boolean': 0, 'image/Hue.mean:types/string': 0, 'image/Hue.mean:types/object': 0, 'image/Hue.mean:cardinality/est': 1.0, 'image/Hue.mean:cardinality/upper_1': 1.000049929250618, 'image/Hue.mean:cardinality/lower_1': 1.0, 'image/Hue.mean:distribution/mean': 0.0, 'image/Hue.mean:distribution/stddev': 0.0, 'image/Hue.mean:distribution/n': 1, 'image/Hue.mean:distribution/max': 0.0, 'image/Hue.mean:distribution/min': 0.0, 'image/Hue.mean:distribution/q_01': 0.0, 'image/Hue.mean:distribution/q_05': 0.0, 'image/Hue.mean:distribution/q_10': 0.0, 'image/Hue.mean:distribution/q_25': 0.0, 'image/Hue.mean:distribution/median': 0.0, 'image/Hue.mean:distribution/q_75': 0.0, 'image/Hue.mean:distribution/q_90': 0.0, 'image/Hue.mean:distribution/q_95': 0.0, 'image/Hue.mean:distribution/q_99': 0.0, 'image/Hue.stddev:counts/n': 1, 'image/Hue.stddev:counts/null': 0, 'image/Hue.stddev:types/integral': 0, 'image/Hue.stddev:types/fractional': 1, 'image/Hue.stddev:types/boolean': 0, 'image/Hue.stddev:types/string': 0, 'image/Hue.stddev:types/object': 0, 'image/Hue.stddev:cardinality/est': 1.0, 'image/Hue.stddev:cardinality/upper_1': 1.000049929250618, 'image/Hue.stddev:cardinality/lower_1': 1.0, 'image/Hue.stddev:distribution/mean': 0.0, 'image/Hue.stddev:distribution/stddev': 0.0, 'image/Hue.stddev:distribution/n': 1, 'image/Hue.stddev:distribution/max': 0.0, 'image/Hue.stddev:distribution/min': 0.0, 'image/Hue.stddev:distribution/q_01': 0.0, 'image/Hue.stddev:distribution/q_05': 0.0, 'image/Hue.stddev:distribution/q_10': 0.0, 'image/Hue.stddev:distribution/q_25': 0.0, 'image/Hue.stddev:distribution/median': 0.0, 'image/Hue.stddev:distribution/q_75': 0.0, 'image/Hue.stddev:distribution/q_90': 0.0, 'image/Hue.stddev:distribution/q_95': 0.0, 'image/Hue.stddev:distribution/q_99': 0.0, 'image/Saturation.mean:counts/n': 1, 'image/Saturation.mean:counts/null': 0, 'image/Saturation.mean:types/integral': 0, 'image/Saturation.mean:types/fractional': 1, 'image/Saturation.mean:types/boolean': 0, 'image/Saturation.mean:types/string': 0, 'image/Saturation.mean:types/object': 0, 'image/Saturation.mean:cardinality/est': 1.0, 'image/Saturation.mean:cardinality/upper_1': 1.000049929250618, 'image/Saturation.mean:cardinality/lower_1': 1.0, 'image/Saturation.mean:distribution/mean': 0.0, 'image/Saturation.mean:distribution/stddev': 0.0, 'image/Saturation.mean:distribution/n': 1, 'image/Saturation.mean:distribution/max': 0.0, 'image/Saturation.mean:distribution/min': 0.0, 'image/Saturation.mean:distribution/q_01': 0.0, 'image/Saturation.mean:distribution/q_05': 0.0, 'image/Saturation.mean:distribution/q_10': 0.0, 'image/Saturation.mean:distribution/q_25': 0.0, 'image/Saturation.mean:distribution/median': 0.0, 'image/Saturation.mean:distribution/q_75': 0.0, 'image/Saturation.mean:distribution/q_90': 0.0, 'image/Saturation.mean:distribution/q_95': 0.0, 'image/Saturation.mean:distribution/q_99': 0.0, 'image/Saturation.stddev:counts/n': 1, 'image/Saturation.stddev:counts/null': 0, 'image/Saturation.stddev:types/integral': 0, 'image/Saturation.stddev:types/fractional': 1, 'image/Saturation.stddev:types/boolean': 0, 'image/Saturation.stddev:types/string': 0, 'image/Saturation.stddev:types/object': 0, 'image/Saturation.stddev:cardinality/est': 1.0, 'image/Saturation.stddev:cardinality/upper_1': 1.000049929250618, 'image/Saturation.stddev:cardinality/lower_1': 1.0, 'image/Saturation.stddev:distribution/mean': 0.0, 'image/Saturation.stddev:distribution/stddev': 0.0, 'image/Saturation.stddev:distribution/n': 1, 'image/Saturation.stddev:distribution/max': 0.0, 'image/Saturation.stddev:distribution/min': 0.0, 'image/Saturation.stddev:distribution/q_01': 0.0, 'image/Saturation.stddev:distribution/q_05': 0.0, 'image/Saturation.stddev:distribution/q_10': 0.0, 'image/Saturation.stddev:distribution/q_25': 0.0, 'image/Saturation.stddev:distribution/median': 0.0, 'image/Saturation.stddev:distribution/q_75': 0.0, 'image/Saturation.stddev:distribution/q_90': 0.0, 'image/Saturation.stddev:distribution/q_95': 0.0, 'image/Saturation.stddev:distribution/q_99': 0.0, 'image/Brightness.mean:counts/n': 1, 'image/Brightness.mean:counts/null': 0, 'image/Brightness.mean:types/integral': 0, 'image/Brightness.mean:types/fractional': 1, 'image/Brightness.mean:types/boolean': 0, 'image/Brightness.mean:types/string': 0, 'image/Brightness.mean:types/object': 0, 'image/Brightness.mean:cardinality/est': 1.0, 'image/Brightness.mean:cardinality/upper_1': 1.000049929250618, 'image/Brightness.mean:cardinality/lower_1': 1.0, 'image/Brightness.mean:distribution/mean': 91.99722290039062, 'image/Brightness.mean:distribution/stddev': 0.0, 'image/Brightness.mean:distribution/n': 1, 'image/Brightness.mean:distribution/max': 91.99722290039062, 'image/Brightness.mean:distribution/min': 91.99722290039062, 'image/Brightness.mean:distribution/q_01': 91.99722290039062, 'image/Brightness.mean:distribution/q_05': 91.99722290039062, 'image/Brightness.mean:distribution/q_10': 91.99722290039062, 'image/Brightness.mean:distribution/q_25': 91.99722290039062, 'image/Brightness.mean:distribution/median': 91.99722290039062, 'image/Brightness.mean:distribution/q_75': 91.99722290039062, 'image/Brightness.mean:distribution/q_90': 91.99722290039062, 'image/Brightness.mean:distribution/q_95': 91.99722290039062, 'image/Brightness.mean:distribution/q_99': 91.99722290039062, 'image/Brightness.stddev:counts/n': 1, 'image/Brightness.stddev:counts/null': 0, 'image/Brightness.stddev:types/integral': 0, 'image/Brightness.stddev:types/fractional': 1, 'image/Brightness.stddev:types/boolean': 0, 'image/Brightness.stddev:types/string': 0, 'image/Brightness.stddev:types/object': 0, 'image/Brightness.stddev:cardinality/est': 1.0, 'image/Brightness.stddev:cardinality/upper_1': 1.000049929250618, 'image/Brightness.stddev:cardinality/lower_1': 1.0, 'image/Brightness.stddev:distribution/mean': 41.904298558131785, 'image/Brightness.stddev:distribution/stddev': 0.0, 'image/Brightness.stddev:distribution/n': 1, 'image/Brightness.stddev:distribution/max': 41.904298558131785, 'image/Brightness.stddev:distribution/min': 41.904298558131785, 'image/Brightness.stddev:distribution/q_01': 41.904298558131785, 'image/Brightness.stddev:distribution/q_05': 41.904298558131785, 'image/Brightness.stddev:distribution/q_10': 41.904298558131785, 'image/Brightness.stddev:distribution/q_25': 41.904298558131785, 'image/Brightness.stddev:distribution/median': 41.904298558131785, 'image/Brightness.stddev:distribution/q_75': 41.904298558131785, 'image/Brightness.stddev:distribution/q_90': 41.904298558131785, 'image/Brightness.stddev:distribution/q_95': 41.904298558131785, 'image/Brightness.stddev:distribution/q_99': 41.904298558131785}
By default, any numerical or string valued EXIF tags will be included in the image profile. You can control which tags are included via the allowed_exif_tags
and forbidden_exif_tags
members of the ImageMetricConfig
. These are both sets of strings naming the allowed or forbidden EXIF tag names. If allowed_exif_tags
is non-empty, only the tags it contains will be included in the profile. Any tags listed in forbidden_exif_tags
will be excluded from the profile (handy in case any of the tags are considered PII). In this example, we'll exclude the Artist
tag from the profile.
no_pii_config = ImageMetricConfig(forbidden_exif_tags={"Artist"})
no_pii_schema = DatasetSchema(resolvers=ImageResolver(), default_configs=no_pii_config)
results = log_image(img3, schema=no_pii_schema)
print(results.view().get_column("image").to_summary_dict())
{'image/DateTimeOriginal:counts/n': 1, 'image/DateTimeOriginal:counts/null': 0, 'image/DateTimeOriginal:types/integral': 0, 'image/DateTimeOriginal:types/fractional': 0, 'image/DateTimeOriginal:types/boolean': 0, 'image/DateTimeOriginal:types/string': 1, 'image/DateTimeOriginal:types/object': 0, 'image/DateTimeOriginal:cardinality/est': 1.0, 'image/DateTimeOriginal:cardinality/upper_1': 1.000049929250618, 'image/DateTimeOriginal:cardinality/lower_1': 1.0, 'image/DateTimeOriginal:frequent_items/frequent_strings': [FrequentItem(value='2099:09:29 10:10:10', est=1, upper=1, lower=1)], 'image/ExifIFD:counts/n': 1, 'image/ExifIFD:counts/null': 0, 'image/ExifIFD:types/integral': 1, 'image/ExifIFD:types/fractional': 0, 'image/ExifIFD:types/boolean': 0, 'image/ExifIFD:types/string': 0, 'image/ExifIFD:types/object': 0, 'image/ExifIFD:cardinality/est': 1.0, 'image/ExifIFD:cardinality/upper_1': 1.000049929250618, 'image/ExifIFD:cardinality/lower_1': 1.0, 'image/ExifIFD:distribution/mean': 105.0, 'image/ExifIFD:distribution/stddev': 0.0, 'image/ExifIFD:distribution/n': 1, 'image/ExifIFD:distribution/max': 105.0, 'image/ExifIFD:distribution/min': 105.0, 'image/ExifIFD:distribution/q_01': 105.0, 'image/ExifIFD:distribution/q_05': 105.0, 'image/ExifIFD:distribution/q_10': 105.0, 'image/ExifIFD:distribution/q_25': 105.0, 'image/ExifIFD:distribution/median': 105.0, 'image/ExifIFD:distribution/q_75': 105.0, 'image/ExifIFD:distribution/q_90': 105.0, 'image/ExifIFD:distribution/q_95': 105.0, 'image/ExifIFD:distribution/q_99': 105.0, 'image/ExifIFD:ints/max': 105, 'image/ExifIFD:ints/min': 105, 'image/ExifIFD:frequent_items/frequent_strings': [FrequentItem(value='105.000000', est=1, upper=1, lower=1)], 'image/Sharpness:counts/n': 1, 'image/Sharpness:counts/null': 0, 'image/Sharpness:types/integral': 1, 'image/Sharpness:types/fractional': 0, 'image/Sharpness:types/boolean': 0, 'image/Sharpness:types/string': 0, 'image/Sharpness:types/object': 0, 'image/Sharpness:cardinality/est': 1.0, 'image/Sharpness:cardinality/upper_1': 1.000049929250618, 'image/Sharpness:cardinality/lower_1': 1.0, 'image/Sharpness:distribution/mean': 65535.0, 'image/Sharpness:distribution/stddev': 0.0, 'image/Sharpness:distribution/n': 1, 'image/Sharpness:distribution/max': 65535.0, 'image/Sharpness:distribution/min': 65535.0, 'image/Sharpness:distribution/q_01': 65535.0, 'image/Sharpness:distribution/q_05': 65535.0, 'image/Sharpness:distribution/q_10': 65535.0, 'image/Sharpness:distribution/q_25': 65535.0, 'image/Sharpness:distribution/median': 65535.0, 'image/Sharpness:distribution/q_75': 65535.0, 'image/Sharpness:distribution/q_90': 65535.0, 'image/Sharpness:distribution/q_95': 65535.0, 'image/Sharpness:distribution/q_99': 65535.0, 'image/Sharpness:ints/max': 65535, 'image/Sharpness:ints/min': 65535, 'image/Sharpness:frequent_items/frequent_strings': [FrequentItem(value='65535.000000', est=1, upper=1, lower=1)], 'image/Software:counts/n': 1, 'image/Software:counts/null': 0, 'image/Software:types/integral': 0, 'image/Software:types/fractional': 0, 'image/Software:types/boolean': 0, 'image/Software:types/string': 1, 'image/Software:types/object': 0, 'image/Software:cardinality/est': 1.0, 'image/Software:cardinality/upper_1': 1.000049929250618, 'image/Software:cardinality/lower_1': 1.0, 'image/Software:frequent_items/frequent_strings': [FrequentItem(value='piexif', est=1, upper=1, lower=1)], 'image/LensSpecification:counts/n': 1, 'image/LensSpecification:counts/null': 0, 'image/LensSpecification:types/integral': 0, 'image/LensSpecification:types/fractional': 0, 'image/LensSpecification:types/boolean': 0, 'image/LensSpecification:types/string': 0, 'image/LensSpecification:types/object': 1, 'image/LensSpecification:cardinality/est': 0.0, 'image/LensSpecification:cardinality/upper_1': 0.0, 'image/LensSpecification:cardinality/lower_1': 0.0, 'image/LensMake:counts/n': 1, 'image/LensMake:counts/null': 0, 'image/LensMake:types/integral': 0, 'image/LensMake:types/fractional': 0, 'image/LensMake:types/boolean': 0, 'image/LensMake:types/string': 1, 'image/LensMake:types/object': 0, 'image/LensMake:cardinality/est': 1.0, 'image/LensMake:cardinality/upper_1': 1.000049929250618, 'image/LensMake:cardinality/lower_1': 1.0, 'image/LensMake:frequent_items/frequent_strings': [FrequentItem(value='LensMake', est=1, upper=1, lower=1)], 'image/XResolution:counts/n': 1, 'image/XResolution:counts/null': 0, 'image/XResolution:types/integral': 0, 'image/XResolution:types/fractional': 0, 'image/XResolution:types/boolean': 0, 'image/XResolution:types/string': 0, 'image/XResolution:types/object': 1, 'image/XResolution:cardinality/est': 0.0, 'image/XResolution:cardinality/upper_1': 0.0, 'image/XResolution:cardinality/lower_1': 0.0, 'image/YResolution:counts/n': 1, 'image/YResolution:counts/null': 0, 'image/YResolution:types/integral': 0, 'image/YResolution:types/fractional': 0, 'image/YResolution:types/boolean': 0, 'image/YResolution:types/string': 0, 'image/YResolution:types/object': 1, 'image/YResolution:cardinality/est': 0.0, 'image/YResolution:cardinality/upper_1': 0.0, 'image/YResolution:cardinality/lower_1': 0.0, 'image/ImagePixelWidth:counts/n': 1, 'image/ImagePixelWidth:counts/null': 0, 'image/ImagePixelWidth:types/integral': 1, 'image/ImagePixelWidth:types/fractional': 0, 'image/ImagePixelWidth:types/boolean': 0, 'image/ImagePixelWidth:types/string': 0, 'image/ImagePixelWidth:types/object': 0, 'image/ImagePixelWidth:cardinality/est': 1.0, 'image/ImagePixelWidth:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelWidth:cardinality/lower_1': 1.0, 'image/ImagePixelWidth:distribution/mean': 256.0, 'image/ImagePixelWidth:distribution/stddev': 0.0, 'image/ImagePixelWidth:distribution/n': 1, 'image/ImagePixelWidth:distribution/max': 256.0, 'image/ImagePixelWidth:distribution/min': 256.0, 'image/ImagePixelWidth:distribution/q_01': 256.0, 'image/ImagePixelWidth:distribution/q_05': 256.0, 'image/ImagePixelWidth:distribution/q_10': 256.0, 'image/ImagePixelWidth:distribution/q_25': 256.0, 'image/ImagePixelWidth:distribution/median': 256.0, 'image/ImagePixelWidth:distribution/q_75': 256.0, 'image/ImagePixelWidth:distribution/q_90': 256.0, 'image/ImagePixelWidth:distribution/q_95': 256.0, 'image/ImagePixelWidth:distribution/q_99': 256.0, 'image/ImagePixelWidth:ints/max': 256, 'image/ImagePixelWidth:ints/min': 256, 'image/ImagePixelWidth:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/ImagePixelHeight:counts/n': 1, 'image/ImagePixelHeight:counts/null': 0, 'image/ImagePixelHeight:types/integral': 1, 'image/ImagePixelHeight:types/fractional': 0, 'image/ImagePixelHeight:types/boolean': 0, 'image/ImagePixelHeight:types/string': 0, 'image/ImagePixelHeight:types/object': 0, 'image/ImagePixelHeight:cardinality/est': 1.0, 'image/ImagePixelHeight:cardinality/upper_1': 1.000049929250618, 'image/ImagePixelHeight:cardinality/lower_1': 1.0, 'image/ImagePixelHeight:distribution/mean': 256.0, 'image/ImagePixelHeight:distribution/stddev': 0.0, 'image/ImagePixelHeight:distribution/n': 1, 'image/ImagePixelHeight:distribution/max': 256.0, 'image/ImagePixelHeight:distribution/min': 256.0, 'image/ImagePixelHeight:distribution/q_01': 256.0, 'image/ImagePixelHeight:distribution/q_05': 256.0, 'image/ImagePixelHeight:distribution/q_10': 256.0, 'image/ImagePixelHeight:distribution/q_25': 256.0, 'image/ImagePixelHeight:distribution/median': 256.0, 'image/ImagePixelHeight:distribution/q_75': 256.0, 'image/ImagePixelHeight:distribution/q_90': 256.0, 'image/ImagePixelHeight:distribution/q_95': 256.0, 'image/ImagePixelHeight:distribution/q_99': 256.0, 'image/ImagePixelHeight:ints/max': 256, 'image/ImagePixelHeight:ints/min': 256, 'image/ImagePixelHeight:frequent_items/frequent_strings': [FrequentItem(value='256.000000', est=1, upper=1, lower=1)], 'image/Colorspace:counts/n': 1, 'image/Colorspace:counts/null': 0, 'image/Colorspace:types/integral': 0, 'image/Colorspace:types/fractional': 0, 'image/Colorspace:types/boolean': 0, 'image/Colorspace:types/string': 1, 'image/Colorspace:types/object': 0, 'image/Colorspace:cardinality/est': 1.0, 'image/Colorspace:cardinality/upper_1': 1.000049929250618, 'image/Colorspace:cardinality/lower_1': 1.0, 'image/Colorspace:frequent_items/frequent_strings': [FrequentItem(value='L', est=1, upper=1, lower=1)], 'image/Hue.mean:counts/n': 1, 'image/Hue.mean:counts/null': 0, 'image/Hue.mean:types/integral': 0, 'image/Hue.mean:types/fractional': 1, 'image/Hue.mean:types/boolean': 0, 'image/Hue.mean:types/string': 0, 'image/Hue.mean:types/object': 0, 'image/Hue.mean:cardinality/est': 1.0, 'image/Hue.mean:cardinality/upper_1': 1.000049929250618, 'image/Hue.mean:cardinality/lower_1': 1.0, 'image/Hue.mean:distribution/mean': 0.0, 'image/Hue.mean:distribution/stddev': 0.0, 'image/Hue.mean:distribution/n': 1, 'image/Hue.mean:distribution/max': 0.0, 'image/Hue.mean:distribution/min': 0.0, 'image/Hue.mean:distribution/q_01': 0.0, 'image/Hue.mean:distribution/q_05': 0.0, 'image/Hue.mean:distribution/q_10': 0.0, 'image/Hue.mean:distribution/q_25': 0.0, 'image/Hue.mean:distribution/median': 0.0, 'image/Hue.mean:distribution/q_75': 0.0, 'image/Hue.mean:distribution/q_90': 0.0, 'image/Hue.mean:distribution/q_95': 0.0, 'image/Hue.mean:distribution/q_99': 0.0, 'image/Hue.stddev:counts/n': 1, 'image/Hue.stddev:counts/null': 0, 'image/Hue.stddev:types/integral': 0, 'image/Hue.stddev:types/fractional': 1, 'image/Hue.stddev:types/boolean': 0, 'image/Hue.stddev:types/string': 0, 'image/Hue.stddev:types/object': 0, 'image/Hue.stddev:cardinality/est': 1.0, 'image/Hue.stddev:cardinality/upper_1': 1.000049929250618, 'image/Hue.stddev:cardinality/lower_1': 1.0, 'image/Hue.stddev:distribution/mean': 0.0, 'image/Hue.stddev:distribution/stddev': 0.0, 'image/Hue.stddev:distribution/n': 1, 'image/Hue.stddev:distribution/max': 0.0, 'image/Hue.stddev:distribution/min': 0.0, 'image/Hue.stddev:distribution/q_01': 0.0, 'image/Hue.stddev:distribution/q_05': 0.0, 'image/Hue.stddev:distribution/q_10': 0.0, 'image/Hue.stddev:distribution/q_25': 0.0, 'image/Hue.stddev:distribution/median': 0.0, 'image/Hue.stddev:distribution/q_75': 0.0, 'image/Hue.stddev:distribution/q_90': 0.0, 'image/Hue.stddev:distribution/q_95': 0.0, 'image/Hue.stddev:distribution/q_99': 0.0, 'image/Saturation.mean:counts/n': 1, 'image/Saturation.mean:counts/null': 0, 'image/Saturation.mean:types/integral': 0, 'image/Saturation.mean:types/fractional': 1, 'image/Saturation.mean:types/boolean': 0, 'image/Saturation.mean:types/string': 0, 'image/Saturation.mean:types/object': 0, 'image/Saturation.mean:cardinality/est': 1.0, 'image/Saturation.mean:cardinality/upper_1': 1.000049929250618, 'image/Saturation.mean:cardinality/lower_1': 1.0, 'image/Saturation.mean:distribution/mean': 0.0, 'image/Saturation.mean:distribution/stddev': 0.0, 'image/Saturation.mean:distribution/n': 1, 'image/Saturation.mean:distribution/max': 0.0, 'image/Saturation.mean:distribution/min': 0.0, 'image/Saturation.mean:distribution/q_01': 0.0, 'image/Saturation.mean:distribution/q_05': 0.0, 'image/Saturation.mean:distribution/q_10': 0.0, 'image/Saturation.mean:distribution/q_25': 0.0, 'image/Saturation.mean:distribution/median': 0.0, 'image/Saturation.mean:distribution/q_75': 0.0, 'image/Saturation.mean:distribution/q_90': 0.0, 'image/Saturation.mean:distribution/q_95': 0.0, 'image/Saturation.mean:distribution/q_99': 0.0, 'image/Saturation.stddev:counts/n': 1, 'image/Saturation.stddev:counts/null': 0, 'image/Saturation.stddev:types/integral': 0, 'image/Saturation.stddev:types/fractional': 1, 'image/Saturation.stddev:types/boolean': 0, 'image/Saturation.stddev:types/string': 0, 'image/Saturation.stddev:types/object': 0, 'image/Saturation.stddev:cardinality/est': 1.0, 'image/Saturation.stddev:cardinality/upper_1': 1.000049929250618, 'image/Saturation.stddev:cardinality/lower_1': 1.0, 'image/Saturation.stddev:distribution/mean': 0.0, 'image/Saturation.stddev:distribution/stddev': 0.0, 'image/Saturation.stddev:distribution/n': 1, 'image/Saturation.stddev:distribution/max': 0.0, 'image/Saturation.stddev:distribution/min': 0.0, 'image/Saturation.stddev:distribution/q_01': 0.0, 'image/Saturation.stddev:distribution/q_05': 0.0, 'image/Saturation.stddev:distribution/q_10': 0.0, 'image/Saturation.stddev:distribution/q_25': 0.0, 'image/Saturation.stddev:distribution/median': 0.0, 'image/Saturation.stddev:distribution/q_75': 0.0, 'image/Saturation.stddev:distribution/q_90': 0.0, 'image/Saturation.stddev:distribution/q_95': 0.0, 'image/Saturation.stddev:distribution/q_99': 0.0, 'image/Brightness.mean:counts/n': 1, 'image/Brightness.mean:counts/null': 0, 'image/Brightness.mean:types/integral': 0, 'image/Brightness.mean:types/fractional': 1, 'image/Brightness.mean:types/boolean': 0, 'image/Brightness.mean:types/string': 0, 'image/Brightness.mean:types/object': 0, 'image/Brightness.mean:cardinality/est': 1.0, 'image/Brightness.mean:cardinality/upper_1': 1.000049929250618, 'image/Brightness.mean:cardinality/lower_1': 1.0, 'image/Brightness.mean:distribution/mean': 44.71923828125, 'image/Brightness.mean:distribution/stddev': 0.0, 'image/Brightness.mean:distribution/n': 1, 'image/Brightness.mean:distribution/max': 44.71923828125, 'image/Brightness.mean:distribution/min': 44.71923828125, 'image/Brightness.mean:distribution/q_01': 44.71923828125, 'image/Brightness.mean:distribution/q_05': 44.71923828125, 'image/Brightness.mean:distribution/q_10': 44.71923828125, 'image/Brightness.mean:distribution/q_25': 44.71923828125, 'image/Brightness.mean:distribution/median': 44.71923828125, 'image/Brightness.mean:distribution/q_75': 44.71923828125, 'image/Brightness.mean:distribution/q_90': 44.71923828125, 'image/Brightness.mean:distribution/q_95': 44.71923828125, 'image/Brightness.mean:distribution/q_99': 44.71923828125, 'image/Brightness.stddev:counts/n': 1, 'image/Brightness.stddev:counts/null': 0, 'image/Brightness.stddev:types/integral': 0, 'image/Brightness.stddev:types/fractional': 1, 'image/Brightness.stddev:types/boolean': 0, 'image/Brightness.stddev:types/string': 0, 'image/Brightness.stddev:types/object': 0, 'image/Brightness.stddev:cardinality/est': 1.0, 'image/Brightness.stddev:cardinality/upper_1': 1.000049929250618, 'image/Brightness.stddev:cardinality/lower_1': 1.0, 'image/Brightness.stddev:distribution/mean': 25.719757982712743, 'image/Brightness.stddev:distribution/stddev': 0.0, 'image/Brightness.stddev:distribution/n': 1, 'image/Brightness.stddev:distribution/max': 25.719757982712743, 'image/Brightness.stddev:distribution/min': 25.719757982712743, 'image/Brightness.stddev:distribution/q_01': 25.719757982712743, 'image/Brightness.stddev:distribution/q_05': 25.719757982712743, 'image/Brightness.stddev:distribution/q_10': 25.719757982712743, 'image/Brightness.stddev:distribution/q_25': 25.719757982712743, 'image/Brightness.stddev:distribution/median': 25.719757982712743, 'image/Brightness.stddev:distribution/q_75': 25.719757982712743, 'image/Brightness.stddev:distribution/q_90': 25.719757982712743, 'image/Brightness.stddev:distribution/q_95': 25.719757982712743, 'image/Brightness.stddev:distribution/q_99': 25.719757982712743}
The profiles produced by log_image()
or log()
with a DatasetSchema
that includes an ImageMetric
can be sent to whylabs just like any whylogs profile. Edit this cell to use the organization and model ID you setup when you created your whylabs account.
import getpass
import os
from datetime import datetime
from typing import Dict
from whylogs.api.writer.whylabs import WhyLabsWriter
# set your org-id here - should be something like "org-xxxx"
os.environ["WHYLABS_DEFAULT_ORG_ID"] = "org-XXXX"
# set your datased_id (or model_id) here - should be something like "model-xxxx"
os.environ["WHYLABS_DEFAULT_DATASET_ID"] = "model-XXXX"
# set your API key here
print("Enter your WhyLabs API key")
os.environ["WHYLABS_API_KEY"] = getpass.getpass()
print("Using API Key ID: ", os.environ["WHYLABS_API_KEY"][0:10])
profile = log_image(img3, schema=no_pii_schema).profile()
profile.set_dataset_timestamp(datetime.now())
view = profile.view()
writer = WhyLabsWriter()
writer.write(profile=view)
Each tracked EXIF tag becomes a feature when viewed in the whylabs profile.