MCPcopy Index your code
hub / github.com/OlafenwaMoses/ImageAI

github.com/OlafenwaMoses/ImageAI @2.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.1.0 ↗ · + Follow
446 symbols 1,470 edges 109 files 171 documented · 38% updated 1y agotest-resources-v3 · 2022-12-20★ 8,872295 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ImageAI (v 2.0.3)

A python library built to empower developers to build applications and systems with self-contained Deep Learning and Computer Vision capabilities using simple and few lines of code.

An DeepQuest AI project https://deepquestai.com . Developed and Maintained by Moses Olafenwa and John Olafenwa, brothers, creators of TorchFusion, Authors of Introduction to Deep Computer Vision and creators of DeepStack AI Server.


Built with simplicity in mind, ImageAI supports a list of state-of-the-art Machine Learning algorithms for image prediction, custom image prediction, object detection, video detection, video object tracking and image predictions trainings. ImageAI currently supports image prediction and training using 4 different Machine Learning algorithms trained on the ImageNet-1000 dataset. ImageAI also supports object detection, video detection and object tracking using RetinaNet, YOLOv3 and TinyYOLOv3 trained on COCO dataset. Finally, ImageAI allows you to train custom models for your peforming recognition of new objects.

                               Eventually, <b>ImageAI</b> will provide support for a wider
and more specialized aspects of Computer Vision including and not limited to image 
recognition in special environments and special fields.

New Release : ImageAI 2.0.3

What's new:

TABLE OF CONTENTS

▣ Dependencies

▣ Installation

▣ Image Prediction

▣ Object Detection

▣ Video Object Detection, Tracking & Analysis

▣ Custom Model Training

▣ Custom Image Prediction

▣ Documentation

▣ Projects Built on ImageAI

▣ High Performance Implementation

▣ AI Practice Recommendations

▣ Contact Developers

▣ Contributors

▣ References

Dependencies

To use ImageAI in your application developments, you must have installed the following dependencies before you install ImageAI :

   <span><b>- Python 3.5.1 (and later versions) </b>      <a href="https://www.python.org/downloads/" style="text-decoration: none;" >Download</a> (Support for Python 2.7 coming soon) </span>


   <span><b>- pip3 </b>              <a href="https://pypi.python.org/pypi/pip" style="text-decoration: none;" >Install</a></span>


   <span><b>- Tensorflow 1.4.0 (and later versions)  </b>      <a href="https://www.tensorflow.org/install/install_windows" style="text-decoration: none;" > Install</a></span> or install via pip <pre> pip3 install --upgrade tensorflow </pre>

- OpenCV Install or install via pip

 pip3 install opencv-python 

- Keras 2.x Install or install via pip

 pip3 install keras 

Installation

To install ImageAI, run the python installation instruction below in the command line:

<span>      <b><pre>pip3 install https://github.com/OlafenwaMoses/ImageAI/releases/download/2.0.3/imageai-2.0.3-py3-none-any.whl </pre></b></span>

or download the Python Wheel imageai-2.0.3-py3-none-any.whl and run the python installation instruction in the command line to the path of the file like the one below:

<span>      <b><pre>pip3 install C:\User\MyUser\Downloads\imageai-2.0.3-py3-none-any.whl</pre></b></span>

Image Prediction

convertible : 52.459555864334106
sports_car : 37.61284649372101
pickup : 3.1751200556755066
car_wheel : 1.817505806684494
minivan : 1.7487050965428352

ImageAI provides 4 different algorithms and model types to perform image prediction, trained on the ImageNet-1000 dataset. The 4 algorithms provided for image prediction include SqueezeNet, ResNet, InceptionV3 and DenseNet.

Click the link below to see the full sample codes, explanations and best practices guide.

>>> Tutorial & Guide

Object Detection

      <b>

Input Image

      <img src="https://github.com/OlafenwaMoses/ImageAI/raw/2.1.0/images/image2.jpg" style="width: 500px; height: auto; margin-left: 50px; " />


      <b>

Output Image

person : 91.946941614151
--------------------------------
person : 73.61021637916565
--------------------------------
laptop : 90.24320840835571
--------------------------------
laptop : 73.6881673336029
--------------------------------
laptop : 95.16398310661316
--------------------------------
person : 87.10319399833679
--------------------------------

ImageAI provides very convenient and powerful methods to perform object detection on images and extract each object from the image. The object detection class provides support for RetinaNet, YOLOv3 and TinyYOLOv3, with options to adjust for state of the art performance or real time processing.

Click the link below to see the full sample codes, explanations and best practices guide.

>>> Tutorial & Guide

Video Object Detection and Tracking

Video Object Detection & Analysis

Below is a snapshot of a video with objects detected.

      <img src="https://github.com/OlafenwaMoses/ImageAI/raw/2.1.0/images/video1.jpg" style="width: 500px; height: auto; margin-left: 50px; " />

Video Custom Object Detection (Object Tracking)

Below is a snapshot of a video with only person, bicycle and motorcyle detected.

      <img src="https://github.com/OlafenwaMoses/ImageAI/raw/2.1.0/images/video2.jpg" style="width: 500px; height: auto; margin-left: 50px; " />

Video Analysis Visualization

Below is a visualization of video analysis returned by ImageAI into a 'per_second' function.

      <img src="https://github.com/OlafenwaMoses/ImageAI/raw/2.1.0/images/video_analysis_visualization.jpg" style="width: 500px; height: auto; margin-left: 50px; " />

ImageAI provides very convenient and powerful methods to perform object detection in videos and track specific object(s). The video object detection class provided only supports the current state-of-the-art RetinaNet, but with options to adjust for state of the art performance or real time processing. Click the link to see the full videos, sample codes, explanations and best practices guide.

>>> Tutorial & Guide

Custom Model Training

A sample from the IdenProf Dataset used to train a Model for predicting professionals.

      <img src="https://github.com/OlafenwaMoses/ImageAI/raw/2.1.0/images/idenprof.jpg" style="width: 500px; height: auto; margin-left: 50px; " />

ImageAI provides classes and methods for you to train a new model that can be used to perform prediction on your own custom objects. You can train your custom models using SqueezeNet, ResNet50, InceptionV3 and DenseNet in 5 lines of code. Click the link below to see the guide to preparing training images, sample training codes, explanations and best practices.

>>> Tutorials & Documentation

Custom Image Prediction

Prediction from a sample model trained on IdenProf, for predicting professionals

  <img src="https://github.com/OlafenwaMoses/ImageAI/raw/2.1.0/images/4.jpg" style="width: 400px; height: auto;" />
<pre>mechanic : 76.82620286941528

chef : 10.106072574853897 waiter : 4.036874696612358 police : 2.6663416996598244 pilot : 2.239348366856575

ImageAI provides classes and methods for you to run image prediction your own custom objects using your own model trained with ImageAI Model Training class. You can use your custom models trained with SqueezeNet, ResNet50, InceptionV3 and DenseNet and the JSON file containing the mapping of the custom object names. Click the link below to see the guide to sample training codes, explanations, and best practices guide.

>>> Tutorials & Documentation

Documentation

We have provided full documentation for all ImageAI classes and functions in 2 major languages. Find links below:

>> Documentation - English Version https://imageai.readthedocs.io

>> Documentation - Chinese Version https://imageai-cn.readthedocs.io

>> Documentation - French Version https://imageai-fr.readthedocs.io

Real-Time and High Performance Implementation

ImageAI provides abstracted and convenient implementations of state-of-the-art Computer Vision technologies. All of ImageAI implementations and code can work on any computer system with moderate CPU capacity. However, the speed of processing for operations like image prediction, object detection and others on CPU is slow and not suitable for real-time applications. To perform real-time Computer Vision operations with high performance, you need to use GPU enabled technologies.

ImageAI uses the Tensorflow backbone for it's Computer Vision operations. Tensorflow supports both CPUs and GPUs ( Specifically NVIDIA GPUs. You can get one for your PC or get a PC that has one) for machine learning and artificial intelligence algorithms' implementations. To use Tensorflow that supports the use of GPUs, follow the link below :

FOR WINDOWS

https://www.tensorflow.org/install/install_windows

FOR macOS

https://www.tensorflow.org/install/install_mac

FOR UBUNTU

https://www.tensorflow.org/install/install_linux

Projects Built on ImageAI

As a demonstration of

Core symbols most depended-on inside this repo

range
called by 104
imageai/Detection/keras_retinanet/backend/tensorflow_backend.py
conv2d_bn
called by 75
imageai/Prediction/InceptionV3/inceptionv3.py
preprocess_input
called by 27
imageai/Prediction/Custom/custom_utils.py
draw_caption
called by 26
imageai/Detection/keras_retinanet/utils/visualization.py
preprocess_input
called by 24
imageai/Prediction/InceptionV3/inceptionv3.py
NetworkConv2D_BN_Leaky
called by 23
imageai/Detection/YOLOv3/models.py
setModelPath
called by 22
imageai/Detection/__init__.py
loadModel
called by 20
imageai/Detection/__init__.py

Shape

Method 223
Function 184
Class 39

Languages

Python100%

Modules by API surface

imageai/Detection/Custom/__init__.py39 symbols
imageai/Detection/keras_retinanet/preprocessing/generator.py24 symbols
imageai/Prediction/Custom/__init__.py23 symbols
imageai/Detection/__init__.py21 symbols
imageai/Detection/keras_retinanet/layers/_misc.py18 symbols
imageai/Detection/keras_retinanet/utils/transform.py15 symbols
imageai/Detection/keras_retinanet/preprocessing/csv_generator.py14 symbols
imageai/Detection/keras_retinanet/preprocessing/open_images.py13 symbols
imageai/Detection/keras_retinanet/preprocessing/coco.py13 symbols
imageai/Detection/keras_retinanet/preprocessing/pascal_voc.py12 symbols
imageai/Detection/keras_retinanet/models/retinanet.py12 symbols
imageai/Detection/keras_resnet/classifiers/_2d.py12 symbols

For agents

$ claude mcp add ImageAI \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact