Skip to main content

A simple, easy to use and customizeble cv library

Project description

Visionlib

A simple high level api made for assisting in cv-related projects.

Features

  • Track faces using
    • MTCNN module
    • Dlib hog Based detector
    • Opencv Haar casscades
    • Dnn based model
  • Predict Gender
  • Detect Objects
    • Yolo v3
    • tiny-yolo

Installation

Dependencies

sudo apt-get install build-essential cmake pkg-config

sudo apt-get install libx11-dev libatlas-base-dev

sudo apt-get install libgtk-3-dev libboost-python-dev

This should install Dependencies required by dlib.

pip install visionlib

This will install visionlib.

Optional

If You want to install from source git clone https://github.com/ashwinvin/Visionlib.git cd visionlib pip install .

Face Detection

Detecting face in an image is easy . This will return the image with bounding box and box coordinates from visionlib.face.detection import FDetector detector = FDetector() detector.detect_face(img, show=True)

This would detect face and display it automatically.

detector.set_detector("mtcnn") Dont like the default detector?, change it like this.

Examples

Detection

Detection

Gender Detection

Once face is detected, it can be passed on to detect_gender() function to recognize gender. It will return the labels (man, woman) and associated probabilities.Like this from visionlib.gender.detection import GDetector Gdetector = GDetector() pred, confidence = Gdetector.detect_gender(c_img)

Example

Gender Detection

Object Detection

Detecting common objects in the scene is enabled through a single function call detect_objects(). It will return the labeled image for the detected objects in the image. By default it uses yolov3-tiny model. from visionlib.object.detection import Detection import cv2 detector = Detection() d_img = detector.detect_objects(img)

You can enable gpu usage by detector.detect_objects(img, enable_gpu=True)

Example

object Detection

For more examples look in examples directory

Project details


Download files

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

Source Distribution

visionlib-1.2.0.tar.gz (10.0 MB view hashes)

Uploaded Source

Built Distribution

visionlib-1.2.0-py3-none-any.whl (10.1 MB view hashes)

Uploaded Python 3

Supported by

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