Allan Thraen
May 19, 2017
  4119
(5 votes)

New add-on in the nuget feed: Enrich your image assets with Azure Cognitive Services.

Back in November as Ascend Nordic, I demoed an early version of this functionality. It was later improved and shown at the opening keynote of Ascend USA. I received quite a lot of requests after that to make it publicly available - and now (I admit a bit late, Jeroen even beat me to it) I'm now sharing it as a nuget package on the Episerver feed - as well as putting my code on GitHub.

Basically, this is how it works:

1) Install the nuget package on your Episerver site. (Episerver.Labs.Cognitive). Note that this is an experimental package and not supported in any way!

2) Add the access key to your appSettings in web.config (details are included in a readme).

And start adding the properties you want to your image model and attach attributes to them to describe what kind of cognitive content you want them populated with!

For instance, to add a descriptive text to your image (can be useful for indexing with Episerver Find or Vulcan) just add this attribute:

[Vision(VisionType =VisionTypes.Description)]
public virtual string Description { get; set; }

To index text recognized in the image add:

[Vision(VisionType=VisionTypes.Text)]
public virtual string TextRecognized { get; set; }

Or, one of my favorite features - Get a smart thumbnail (where the interesting parts of the image are in focus):

[ScaffoldColumn(false)]
[SmartThumbnail(100,100)]
public virtual Blob SmartThumbnail{ get; set; }

You can of course also extract a list of the age and gender of all people in the image like this:

[Vision(VisionType = VisionTypes.Faces)]
[BackingType(typeof(PropertyStringList))]
[Display(Order = 305)]
[UIHint(Global.SiteUIHints.Strings)]
public virtual string[] Faces { get; set; }

and much, much more.

Enjoy!

May 19, 2017

Comments

Please login to comment.
Latest blogs
Boosting Graph Query Performance with Stored Templates

Stored Templates offer a solution by pre-generating and storing translated queries. This bypasses the time-consuming translation process, leading t...

Jonas Bergqvist | Feb 27, 2025

Exploring Optimizely SaaS CMS – What’s New & How to Accelerate your Build

In my latest video, I take a fresh look at Optimizely SaaS CMS , covering some of the recent improvements aimed at enhancing the editor experience....

Minesh Shah (Netcel) | Feb 27, 2025

Adaptive Images with Optimizely CMP

Images from Optimizely CMP can now be seamlessly integrated into Optimizely CMS through Adaptive Images, with the all same features that web editor...

Ted | Feb 27, 2025 |

Using the 1996 text-based Browser 'Links' to optimize website accessibility

Use a text-based browser from the late 1990s to improve the accessibility of your modern Optimizely website!

Tomas Hensrud Gulla | Feb 25, 2025 |

Using the 1996 text-based Browser 'Links' to optimize website accessibility

Use a text-based browser from the late 1990s to improve the accessibility of your modern Optimizely website!

Tomas Hensrud Gulla | Feb 25, 2025 |

Convert media type in a migrationstep

I needed to convert the type for some media files. Suddenly webp files were sent to the CMS from an external system and webp was not added to the...

Jeroen Stemerdink | Feb 24, 2025 |