Flask is a lightweight and incredibly flexible framework for creating website backends in Python. In addition to abstracting difficult web concepts, such as routing, rendering HTML documents, and handling static files, it’s easy to integrate with any of Python’s many libraries.
To show its power, this tutorial will develop a simple website to maintain movies and their IMDb ratings. This website will be a CRUD, which stands for create, read, update, and delete, which are the basic operations of a database. This serves as a good introduction as nearly every website is, at its most basic form, a CRUD. …
The canvas element in HTML5 is a great, versatile tool that allows the creation of both 2D and 3D graphics. Used for everything from hosting pictures to outright gaming, there’s no shortage for creativity in its application.
<link rel="stylesheet" type="text/css" href="sketch.css" media="screen"/>
Just as a note, a separate CSS file will be…
Nothing tells of the ubiquity of satellite imagery like Google Maps. A completely unpaid service provides anyone with internet access a entire planet’s worth of satellite imagery. While Google Maps is free, other paid alternatives exist which take photos of the earth’s surface on a more frequent basis for commercial use. World governments also utilize their satellites for many domestic uses.
As the availability of satellite imagery outpaces the ability of humans to look through them manually, an automated means to classify them must be developed. …
I’ve written about the Mean Shift Algorithm before, but I never gave a practical application of it. I ultimately felt unsatisfied by the article, so I wanted to revisit the topic and apply it to a real world situation.
The Mean Shift algorithm can track objects in real time by using color. The more distinct the color from the background, the better it works. While object tracking presents a huge topic in computer vision, I wanted to focus on the gaming.
Motion control, the art of tracking the physical movement of the player and translating it into a computer input…
The introduction of augmented reality (AR) in smart phones ushered a novel approach to entertainment. From playing games like Pokémon Go to making funny faces on Snapchat, AR has become a commonplace phenomenon.
While these technologies seem advanced enough to borrow from science fiction, creating a fun, Snapchat-style filter in Python is surprisingly straightforward. In this instance, I’ll create a filter that places a pair of sunglasses on a face.
We live in the era of video calls. Conducted over the internet and using whatever camera that comes with your laptop or computer, we broadcast our lives to our classmates, coworkers, and families.
Sometimes, though, we don’t want to broadcast our space. My office, like many others, has a few perennial pieces of clutter. I also have a guitar on the wall behind me, which doesn’t always scream professionalism.
As a result, Zoom and other video calling software includes a feature to hide your background, usually behind an image of your choice. …
Among the most demanded features of computer vision is object tracking. Unfortunately, this is also one of the most difficult aspects of computer vision to implement.
Not only does an object need to be identified, it needs to be identified quickly enough to render in real time while it moves. The object may change orientation or change its distance from the camera, which further complicates matters.
While still an adamant challenge in computer vision, the mean shift and cam shift algorithms present a simplified solution. …
Edge detection is a fundamental tool in computer vision. By using sharp contrasts in brightness, general outlines and shapes can be found in an image. Often used as a filter to find distinctions between items in a photo, edge detection offers a first stepping stone into object recognition.
While many examples…
While Python remains easy to use, quick to learn, and offers an overabundance of external libraries that can do almost anything, it has one critical weakness: it’s slow.
Of course, to the human eye, its sluggishness seems negligible. Usually Python only lags behind other programming languages by milliseconds; however, when iterating over millions or even billions of data points, it quickly adds up.
NumPy offers a unique solution. While allowing users to still write Python, it converts it into well written C code specifically optimized for numerical analysis.
Using NumPy arrays can increase a script’s performance by one or two…
On my first job out of college, I was tasked with streamlining how a company made purchases. While a big project that encompassed many factors, such as lead times and order quantities, the most challenging part was determining how many units would sell over time.
With lead times in excess of 2 or 3 months, I needed to accurately predict if a certain product would run out before a new shipment came. It was a balancing act, because if I underpredicted how much product would sell, the company would run out and lose sales. …