Skip to main content

No project description provided

Project description

Python-TAWNYAPI

Documentation

Simple Example with OpenCV

import cv2
from tawnyapi.vision.client import TawnyVisionApiClient
from tawnyapi.vision import apitypes

VIDEO_PATH = "<PATH TO YOUR VIDEO FILE>"
API_KEY = "<YOUR TAWNY API KEY>"
 
client = TawnyVisionApiClient(api_key=API_KEY)
cap = cv2.VideoCapture(VIDEO_PATH)
 
while True: 
    ret, frame = cap.read()
    if not ret:
        break
 
    # Analyzing images already in memory:
    result = client.analyze_images(
        images=[frame],
        max_results=1,
        resize=None,
        features=[
            apitypes.ImageAnnotationFeatures.FACE_DETECTION,
            apitypes.ImageAnnotationFeatures.FACE_EMOTION,
            apitypes.ImageAnnotationFeatures.FACE_DESCRIPTOR,
            apitypes.ImageAnnotationFeatures.HEAD_POSE,
            apitypes.ImageAnnotationFeatures.FACE_LANDMARKS,
            apitypes.ImageAnnotationFeatures.ATTENTION,
            apitypes.ImageAnnotationFeatures.POSE
        ])
 
    print(result)

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

tawnyapi-0.2.5.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

tawnyapi-0.2.5-py3-none-any.whl (9.3 kB 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