示例#1
0
 def __init__(self, src):
     self._src = src
     self._kinect = Kinect()
     self._body = BodyDetector()
     self._hand = HandDetector()
     self._contour = HandContourDetector()
     self._pose = PoseClassifier(MultiPoseClassifier(src))
示例#2
0
 def __init__(self, id, nsamples, dst):
     self._id       = id
     self._nsamples = nsamples
     self._dst      = dst
     self._kinect   = Kinect()
     self._body     = BodyDetector()
     self._hand     = HandDetector()
     self._contour  = HandContourDetector()
     self._feature  = GaborDescriptors(4, 4)
示例#3
0
 def __init__(self, id, nsamples, dst):
     self._id = id
     self._nsamples = nsamples
     self._dst = dst
     self._kinect = Kinect()
     self._body = BodyDetector()
     self._hand = HandDetector()
     self._contour = HandContourDetector()
     self._fdesc = FourierDescriptors()
     self._train = []
示例#4
0
import cv2
import argparse
import chainer
import hand
from entity import params
from pose import PoseDetector, draw_person_pose
from hand import HandDetector, draw_hand_keypoints


chainer.using_config('enable_backprop', False)

if __name__ == '__main__':

    # load model
    pose_detector = PoseDetector("posenet", "models/coco_posenet.npz")
    hand_detector = HandDetector("handnet", "models/handnet.npz")

    # read image
    img = cv2.imread('data/dinner.png')

    # inference
    print("Estimating pose...")
    person_pose_array, _ = pose_detector(img)
    res_img = cv2.addWeighted(img, 0.6, draw_person_pose(img, person_pose_array), 0.4, 0)

    # each person detected
    for person_pose in person_pose_array:
        unit_length = pose_detector.get_unit_length(person_pose)

        # hands estimation
        print("Estimating hands keypoints...")
示例#5
0
 def __init__(self):
     self._kinect = Kinect()
     self._body = BodyDetector()
     self._hand = HandDetector(HandOtsu())
     self._contour = HandContourDetector()
     self._palm = PalmDetector()
示例#6
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import cv2
import numpy as np
import config

from kinect import Kinect
from body import BodyDetector
from hand import HandDetector, HandContourDetector
from pose import PoseClassifier, OpenCloseClassifier, MultiPoseClassifier


kinect  = Kinect()
body    = BodyDetector()
hand    = HandDetector()
contour = HandContourDetector()
#pose   = PoseClassifier(OpenCloseClassifier())
pose    = PoseClassifier(MultiPoseClassifier())


for (depth, depth8, rgb) in kinect.get_data():

    b = body.run(depth8)
    (h, _) = hand.run(b)

    #cv2.imshow('hand', h)

    (ccc, box, hc) = contour.run(h)

    if len(ccc) < 100: