def getAck():
     facialExpression = intentionClassifier.intentClass(
         1, faceExpModel, faceCascade, detector, predictor)
     print "Detected: " + str(facialExpression)
     if facialExpression == 'happy':
         return 1
     else:
         return 0
示例#2
0
 def getAck(videoNum):
     #videoNum += 1
     vidName = str(videoNum) + '_FER'
     facialExpression = intentionClassifier.intentClass(
         1, faceExpModel, faceCascade, detector, predictor, vidName)
     print "Detected: " + str(facialExpression)
     if facialExpression == 'happy':
         return 1
     else:
         return 0
示例#3
0
        main_fingers(f_closing)
        main_fingers(f_opening)
        main_fingers(f_closing)
        main_fingers(f_opening)

    initialize = 1
    old_box_pos = 'C'  # current position of box at all times
    new_box_pos = ''
    while True:
        if initialize == 1:
            print "Make sure object is in center position!"
            inputCommand = int(
                (raw_input("\nPress 1 to proceed or 2 to cancel...")))
            if inputCommand == 1:
                goToAckPos()
                facialExpression = intentionClassifier.intentClass(
                    1, faceExpModel, faceCascade, detector, predictor)
                print "Detected expression: " + facialExpression
                if facialExpression == 'happy':
                    initialize = 0
                else:
                    print "Initialization failed..."
                    print "Try again..."
            else:
                break

        else:
            print "Moving to ready position..."
            getReadyPosition()
            facialExpression, headMovement = intentionClassifier.intentClass(
                3, faceExpModel, faceCascade, detector, predictor)
            print "Facial Expression: " + facialExpression
示例#4
0
    initialize = 1
    old_box_pos = 'C'  # current position of box at all times
    new_box_pos = ''
    videoNum = 0
    while True:

        if initialize == 1:
            print "Make sure object is in center position!"
            inputCommand = int(
                (raw_input("\nPress 1 to proceed or 2 to cancel...")))
            if inputCommand == 1:
                homePosition()
                ackGesture()
                videoNum += 1
                vidName = str(videoNum) + '_FER'
                facialExpression = intentionClassifier.intentClass(
                    1, faceExpModel, faceCascade, detector, predictor, vidName)
                print "Detected expression: " + facialExpression
                if facialExpression == 'happy':
                    initialize = 0
                else:
                    print "Initialization failed..."
                    print "Try again..."
            else:
                break

        else:
            print "Moving to ready position..."
            getReadyPosition()
            videoNum += 1
            vidName = str(videoNum) + '_HPC'
            headMovement = intentionClassifier.intentClass(