While data science offers many ways to visualize and make predictions with your customer data, most can be time consuming. Worse, you often can’t reuse your code with other datasets.
Sentiment Time Series is a microservice that can be used on a variety of datasets to process unstructured text and return a sentiment time series plot and frequency. Since the microservice handles most of the data processing via an API call, you can spend more time concentrating on your analysis and less time writing code. Read More…
We’re back after a week off the grid. This week we look at how Obama is preparing for the future of AI, how AI assistants are adding the “smart” to smartphones, check in on self-driving cars and other emergent transportation tech, and we take a mulligan on Notes from the Frontier this week — Sorry!
And, per usual, our top projects to try at home, and favorite articles from the past week are down at the bottom. Read More…
It’s not easy to dynamically scale and crop images of different sizes or aspect ratios. Typically, this is resolved in one of two ways: manipulate images by hand (slow, high quality, expensive), or indiscriminately crop-to-fit from the middle-out (fast, low quality, cheap).
Smart Thumbnail is a microservice developers can use to programmatically manipulate images at scale while ensuring that every image is perfectly cropped.
Since web services and social networks can’t employ hundreds of people to manually crop and resize images, they rely on “dumb” algorithms to generate these thumbnails. This is why we experience thumbnails throughout the web of decapitated people, mountains without peaks, or subjects missing from the frame entirely.
Here are two examples of Smart Thumbnail fixing images poorly cropped images:
What is Smart Thumbnail
Smart Thumbnail is a microservice that can automatically resize and crop images with the most relevant parts framed and retained.
This microservice takes advantage of both facial recognition with OpenCV, as well as a deep convolutional network for saliency predication to “learn” where in an image to scale and crop.
For example, the most relevant part of an image with people would probably revolve around their faces.
Smart Thumbnail will use OpenCV to recognize the faces in the image and then crops the image to your desired thumbnail size with the face in the frame. No more decapitated people.
But what if image doesn’t contain people? Good question!
Smart Thumbnail will recognize that, and then use saliency via SalNet, an implementation of the “Shallow and Deep Convolutional Networks for Saliency Prediction” research.
(The technical explanation goes like this: By default, Smart Thumbnail takes the average of the centroid of the largest face it detects, if one is detected, as well as the centroid of saliency in the image to determine where to crop. If no face is detected, Smart Thumbnail will use the centroid of of saliency to figure out what the most important part of the image is, and ensure it’s retained when scaled and cropped.)
Saliency represents the most prominent part of an image, like a person in a painting. The visual representation of saliency could best be seen as a heatmap like this:
Whether or not your image contains people, places, or things, Smart Thumbnail can intelligently crop and resize your images into thumbnails.
Why You Need Smart Thumbnail
By using Smart Thumbnail, you ensure that thumbnails on your site are always perfectly cropped, even if the most salient object isn’t already centered.
When you leverage a microservice like Smart Thumbnail, you can scale your ability to manipulate images on your site programmatically, and avoid embarrassing thumbnails like the examples above.
Or, just look at this real life examples of a poorly cropped image:
Low quality thumbnails like this erode the trust and undermine professionalism.
How to Use Smart Thumbnail
There are a few ways to leverage Smart Thumbnail in your apps and services. The API requires an array with an input URL, output URL, thumbnail width, and thumbnail height.
The input requires either a URL or an Algorithmia Data URI. Your output will be the binary representation of the image, unless you specify a destination for a file when making the API call. This will be saved as a PNG.
The height and width are the desired output size of the image.
To start making calls, you’ll need a free API key from Algorithmia.
Below is the sample input/output. We’ll be using this image for reference:
import Algorithmia input = [ "https://hd.unsplash.com/photo-1466840787022-48e0ec048c8a", "data://.algo/temp/test.png", 500, 500 ] client = Algorithmia.client('API KEY HERE') algo = client.algo('opencv/SmartThumbnail/2.1.1') print algo.pipe(input)
That was easy. Now you have a solution for dynamically generating thumbnails next time you’re working on a web development project, app, or service.
Give a try and let us know what you think @Algorithmia.
This week we cover the historic AI partnership, look at the newAWS P2 GPU instances, ponder humanities mission to Mars, check in on chatbots, catch up on recent news from the Google Research Team, and recap the thoughts, ideas, and opinions inNotes from the Frontier.
Plus, our top projects to try at home, and favorite articles from the past week. Read More…
We’re excited to share that WIRED featured Algorithmia in an article earlier this month that looked at our efforts to democratize access to AI.
📝 From the Blog
This month we show you how to build a Slack chatbot to analyze the sentiment of a channel, create a tool that finds broken links, learn how to solve FizzBuzz using machine learning, and the easiest way to crawl and scrape every page from a domain. Read More…
This is a guest post by Daniël Heres, a software engineer & Computing Science student. Want to contribute your own how-to post? Let us know.
FizzBuzz is a programming exercise some interviewers use to test a developer’s skills. To solve FizzBuzz, count from 1 to 100 and replace numbers divisible by 3 with “fizz”, and numbers divisible by 5 with “buzz.” For numbers divisible by both 3 and 5, we replace them with “fizzbuzz”.
Sounds straight-forward, right?
Instead of programming a bunch of if statements and checking whether each number can be divided by 3 or 5, we’re going to use machine learning. In this tutorial I’ll show you how can create your own AI FizzBuzz model, and host it on Algorithmia. Try the final result here. Read More…
This week we try on Snapchat’s augmented reality glasses, look at free speech and the internet, and recap the thoughts, ideas, and opinions in Notes from the Frontier.
Plus, our top projects to try at home, and our favorite articles from the past week. Read More…
How do you convert an entire website into JSON when an API isn’t available? For many, they’d write a web crawler to first discover every URL on a domain. Then, write a web scraper for each type of page to transform it into structured data. After that, they’d have to de-dupe, strip HTML, and more just to get their data in a structured state. That sounds like a lot of work.
Scraping and extracting structured data from web pages can often be a challenge. There’s typically issues with fetching data, dealing with pagination, handling AJAX, and more.
This week we debut Notes from the Frontier, a collection of thoughts, ideas, and opinions from the Emergent // Future community. Catch up on the chat bot boom, check in on Apple’s plans for augmented reality, and look at the latest news in the self-driving car trend. Read More…