Skip to main content

A utility to help you in your IA projects

Project description

Introduction

I find myself writting the same code over again every time I want to run some experiment or try some new IA stuff most of the time loosing focus on the important thing I'm trying to learn or understand. In order to avoid this pattern I tried to write a small framework that help me have those standard task already solved and at the same time helps me structure the code in a readable and maintainable way.

Installation

This project has been developed with python 3.6.

pip3 install ialab-core

Architectural considerations

I will try to explain they why by means of an example in computer vision. Most of the time I try some experiment it happens to be as follows:

  • I need to read video either from disk or from my notebook camera.
  • The image needs to be scaled for performance reasons
  • I need to run some sort of algorithm on the image (this may imply one or a secuence of algorithms)
  • I want to display the result or optionally display it and send the result to an image or video file

Let's take those steps into a more abstract representation

Read Image -> Scale Image -> Face Detection (to say something specific) -> Display Result -> Send to disk

This looks very similar to a pipes and filters architecture where I can send the output for some step to one or more processors. Nothing new here this is just a graph structure as it is happening on most new technologies stacks that try to help us building better and more maintainable software.

Each processing node in this architecture will be called a Processor. There are special types of Processors which are the input and output ones. The main difference between them is that input processors can run and control the execution (this will change in future versions where a separate executor will appear) and output processor don't try to offer their output for further processing. On the other hand a regular processor will do something with the input data and will offer this data for any other processor that is interested in doing so.

Example

As an example let's thing you have a folder with images where each image contain somewhere in it the face of a person and the file is named as the person. You want to do face detection using a siamesse network but first you want to extract the faces from the images in order to reduce the memory footprint, loading time and the size of the application you deliver to your customer.

To do this you can write down the followin short application using our library.

graph = FaceRecognition(original_pictures_path, [
        FaceExtractor([
            ImageWriter(face_picture_path)]
        )
    ])

video = ImageInput(original_pictures_path, (320, 240), [graph])
video.run()

Running the examples

YoloV3

To run YoloV3 you need to download the configuration files and place them into ./modes/yolov3. There are 3 files that need to be downloaded yolov3.cfg, yolov3.weights and coco.names. These files can be downloaded from https://pjreddie.com/darknet/yolo/.

After downloading just execute python3 obj_recog.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ialab_core-0.2.5-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file ialab_core-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: ialab_core-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for ialab_core-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 74dec77f84e70a9951eb364682f4a06d55f0cbaf1ce396ebe8bf663de7c40eae
MD5 14407e6230be4e15fee195f05637aa8e
BLAKE2b-256 5d28b9c2874d0e77278c8d4e4fe17dfd73a0e4c989cdd8d88ae15b036ded7a97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page