
- Problem statement
- Extract colors from images
- Project structure
- Code
- Deploy the Docker container
- Let’s try it!
- API documentation
- Conclusions
- License disclaimer
Let us imagine a control room of a manufacturing facility, where the fabricated products need to be sorted automatically. For instance, based on their color, goods may be redirected to different branches of a roller conveyor for further processing or packaging.
Otherwise, we can also imagine an online retailer trying to enhance the user experience by adding a search-by-color functionality. Customers may more easily find a clothing item from a particular color, thus simplifying their access to products of interest.
Or, just like the author, you can picture yourself as an IT consultant implementing a simple, fast and reusable tool to generate color palettes for presentations, charts and apps from input images.
These are just few examples of how extracting the main colors from a picture may either improve operational efficiency or boost customer experience.
In this blog post, we use Python to implement the extraction of predominant colors from a given picture. Then, we use FastAPI and Docker to package and deploy the solution as a service.
The purpose of this post is to share an end-to-end illustration about the deployment of a lightweight and self-consistent service leveraging Machine Learning techniques to carry out a business purpose. Such a service may be easily integrated in a microservice architecture.
A digital image is essentially a 2-dimensional grid of individual components known as pixels. Pixels are the smallest unit of display in the image, and carry information about its color. A…
Be the first to comment