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
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
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
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
Built Distribution
Hashes for visionlib-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e0fec8c9336cf478d1a0690cd9270bca879e263c7e35149347f3bfe333736d0 |
|
MD5 | 34888abdd5b0e9537d1c9517e37907a3 |
|
BLAKE2b-256 | d1486a0a5270ecd67e422803e071f182415189771c717a58c9439a7eda91fb3c |