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
Note: Windows compatibility is not tested
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
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
detector = GDetector()
pred, confidence = detector.detect_gender(img)
Example
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)
GPU support
You can leverage your gpu's power by enabling it like this.
Face Detection
detector.detect_face(img, show=True, enable_gpu=True)
Object Detection
detector.detect_objects(img, enable_gpu=True)
Gender Detection
detector.detect_gender(img, enable_gpu=True)
Note: GPU is support in face detection is only compatible with DNN detector and you should cuda installed.
Example
Documentation
Complete Documenation can be found on https://ashwinvin.github.io/Visionlib/
For example check the 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
Built Distribution
Hashes for visionlib-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3321326aa725ed264b538e4cc6a82b3e54967a947d6e7098ead603e098712673 |
|
MD5 | 8344cee0d32190e08d39b6c5dc327ab3 |
|
BLAKE2b-256 | 74f256a4395b7d7398e99e3748bc13fbe7bf7f5937962acc378e92c2541efbca |