예제 #1
0
def processs3():
    companyId = request.args.get("companyId")
    participantId = request.args.get("participantId")
    campaignId = request.args.get("campaignId")
    data = getImages(companyId, campaignId, participantId)
    if(companyId is None or participantId is None or campaignId is None):
        return "Invocation is http://hostname:8000?s3?companyId=demo&campaignId=HJ8rdPEjl&[email protected]"
    else:
        data['participantId'] = participantId
        data['companyId'] = companyId
        data['campaignId'] = campaignId
        response = get_emotion(nets, data, companyId, participantId, campaignId)
        return response
예제 #2
0
파일: api.py 프로젝트: RefineAI/TaktEmotion
def processFrame():
    print ("In Frame")

    content = request.get_json(force=True)

    companyId = content["companyId"]

    #companyId = "abz"

    participantId = content["participantId"]

    #participantId = "123"

    campaignId = content["campaignId"]

    #campaignId = "567"

    image = content["image"]



    timestamp = 0
    if "timestamp" in content:
        timestamp = content["timestamp"]
    if(companyId is None or campaignId is None or participantId is None or image is None):
        return "No POST data found or missing parameters"
    start = image.find(",")
    image64 = image[start + 1:]
    data = {}
    data[time.time()] = image64
    print ("Getting Emos")
    res = get_emotion(nets, data, companyId, campaignId, participantId, timestamp, ageGenderCache)
    #res = detectEmotion(nets["faceCascade"], nets["keras_emo"], image)
    print ("Got emos")
    print (res)
    #res = get_emotion(nets,data, companyId, campaignId, participantId, timestamp, ageGenderCache )
    #print res
    #saveToDB(res)
    print ("Sending response")


    resp = Response(response=res,
                    status=200,
                    mimetype="application/json") 



    return resp