Computer Vision Libraries

Python libraries to work with Images and Videos

Enos Jeba
The Deep Hub

--

Python has made accessing programming a little easier, and with the addition of libraries, we are also able to work with Computer Vision tasks and deployment. Let’s go through the general libraries used for computer vision.

Training

Tensorflow

  • Tensorflow is a platform developed on top of Keras
  • Tensorflow is used to create Neural Networks and can train models
  • Tensorflow is easy to learn
  • Tensorflow also can create lite models which can be used to deploy on mobile devices
  • Tensorboard helps us visualize training metrics

Pytorch

  • Pytorch is based on Torch library created by Facebook (now Meta)
  • Pytorch is widely used in research paper’s
  • The debugging capability makes it favorable choice for researcher’s

Keras

  • Slowly faded into Tensorflow
  • Keras was built keeping user’s in mind
  • It facilitated fast prototyping
  • Easy production of Models

Sklearn

  • Machine Learning Library
  • Equipped with tools for predictive data analysis
  • Have multiple Classification and Regression models built in
  • Sklearn metrics also helps in evaluate the training

mathplotlib

Matplotlib can be used to plot training graphs’s and understand how our neural network is performing. You can also use it to view images side by side for comparison purposes.

Training Graph of Neural Network

Image Operation

Opencv

  • Collection of Computer Vision tools
  • Opencv can help us get live feed from CCTV and process the frames
  • Has support for wide range of cameras including Lidar, Realsensea and PI Cameras

Numpy

  • It’s a math library with advanced calculation capabilities
  • Used as a extension to OpenCV to perform image operations
  • Can apply filter’s on image with it’s matrix functionality

PIL

  • Also known as PILLOW
  • PIL does a variety of Image operations
  • Unlike OpenCV which takes help of NUMPY to crop image or any other activity, PIL has built in tools for it

Imutils

  • Convientient functions found in one package
  • Developed by PyImageSearch
Contor detection using imutils. Source https://www.dounaite.com/

Bonus

Base64

Sending your images across in the original format demands more space. But we can send string easily, So we can use base64 to conver image to a string which can then be passed via api, stored in a notepad or anywhere else you are thinking of.

You can check out this article about Base64 conversion

OS navigation

Sys

  • Sys library helps us in performing system operations
  • Sys.exit() is a most commonly used command to exit out of the code on a given condition

os

  • os, Yes it is Operating system
  • os allows python to interact with the os, so you can do things like creating a folder, changing working directory etc
  • Eg. os.path() library in python helps in locating a file, walking in a folder

Time

  • time.sleep() to take a pause between the code

Datetime

  • Module to get the time, in different formats. You can customize the format as per your requirement

Shutil

  • Shutil helps in moving or copying files across folders / disk

API

requests

  • Requests library is used to connect with API
  • You can pass data to API and Get response from the API

Json

  • Json helps in reading JSON files
  • Good method if you have multi-level records to be stored

Advanced

Logging

  • Better version of Print Statement
  • This helps understand the flow of program in a better way

Threading

  • Multi-Threading is a joke in python, but you can try multi-threading which won’t be running on multiple threads as the name suggests

Multiprocessing

  • Unlike Threading it does utilize CPU better, but those parallel running processes cannot talk to each other!

Whether you are interested in training neural networks, performing image operations, connecting with APIs, or deploying your models, Python has a library for you. Inspire someone to start today :)

Medium’s Boost / AI Predict /FREE GPTs alternative/ Video2Wolds

--

--