· 6 years ago · Mar 02, 2019, 04:14 PM
1s3 = boto3.resource('s3')
2ACCESS_KEY= 'xxxx'
3SECRET_KEY= 'xxxx'
4
5session = boto3.Session(
6aws_access_key_id=ACCESS_KEY,
7aws_secret_access_key=SECRET_KEY
8)
9
10rekognition = session.client('rekognition', region_name='xxx')
11df = pd.read_csv('r.csv')
12
13
14for i, row in df.iterrows():
15 image = str(row['guid'])
16 r = requests.get(row['url'])
17 response_content = r.content
18 face_response = rekognition.detect_faces(Image={'Bytes':
19 response_content}, Attributes=['ALL'])
20 with open('faces.json', 'a') as tf:
21 json.dump(face_response, tf)
22 tf.write("n")
23 contents = open('faces.json', "r").read()
24 data = [json.loads(str(item)) for item in contents.strip().split('n')]
25 with open ('face_final.json', 'w') as m:
26 json.dump(data,m)
27
28[{"FaceDetails": [{"BoundingBox": {"Width": 0.20645833015441895, "Height": 0.34566667675971985, "Left": 0.1320784091949463, "Top": 0.2870468497276306}, "AgeRange": {"Low": 35, "High": 52}, "Smile": {"Value": false, "Confidence": 86.16860961914062}, "Eyeglasses": {"Value": true, "Confidence": 99.21920013427734}, "Sunglasses": {"Value": false, "Confidence": 99.35169982910156}, "Gender": {"Value": "Male", "Confidence": 98.19034576416016}, "Beard": {"Value": false, "Confidence": 94.8172607421875}, "Mustache": {"Value": false, "Confidence": 98.80828094482422}, "EyesOpen": {"Value": true, "Confidence": 99.99850463867188}, "MouthOpen": {"Value": false, "Confidence": 84.43124389648438}, "Emotions": [{"Type": "HAPPY", "Confidence": 6.950818061828613}, {"Type": "ANGRY", "Confidence": 8.036457061767578}, {"Type": "CONFUSED", "Confidence": 30.87822151184082}, {"Type": "CALM", "Confidence": 36.122955322265625}, {"Type": "SURPRISED", "Confidence": 5.876465320587158}, {"Type": "SAD", "Confidence": 9.060415267944336}, {"Type": "DISGUSTED", "Confidence": 3.074671745300293}], "Landmarks": [{"Type": "eyeLeft", "X": 0.20133039355278015, "Y": 0.4523984491825104}, {"Type": "eyeRight", "X": 0.28129422664642334, "Y": 0.4087912440299988}, {"Type": "mouthLeft", "X": 0.24184171855449677, "Y": 0.5613872408866882}, {"Type": "mouthRight", "X": 0.3082438111305237, "Y": 0.5248567461967468}, {"Type": "nose", "X": 0.269692063331604, "Y": 0.49691712856292725}, {"Type": "leftEyeBrowLeft", "X": 0.15909677743911743, "Y": 0.44103655219078064}, {"Type": "leftEyeBrowRight", "X": 0.21194136142730713, "Y": 0.4123869240283966}, {"Type": "leftEyeBrowUp", "X": 0.1844387650489807, "Y": 0.4178501069545746}, {"Type": "rightEyeBrowLeft", "X": 0.25881028175354004, "Y": 0.3871847689151764}, {"Type": "rightEyeBrowRight", "X": 0.3012760579586029, "Y": 0.3637477457523346}, {"Type": "rightEyeBrowUp", "X": 0.2788476049900055, "Y": 0.36720070242881775}, {"Type": "leftEyeLeft", "X": 0.1855049878358841, "Y": 0.4580109119415283}, {"Type": "leftEyeRight", "X": 0.21691501140594482, "Y": 0.44434690475463867}, {"Type": "leftEyeUp", "X": 0.19991904497146606, "Y": 0.44687533378601074}, {"Type": "leftEyeDown", "X": 0.2031686156988144, "Y": 0.4566645622253418}, {"Type": "rightEyeLeft", "X": 0.2643232047557831, "Y": 0.41856878995895386}, {"Type": "rightEyeRight", "X": 0.2917978763580322, "Y": 0.4000416100025177}, {"Type": "rightEyeUp", "X": 0.2787345349788666, "Y": 0.4039233922958374}, {"Type": "rightEyeDown", "X": 0.2809092402458191, "Y": 0.41421836614608765}, {"Type": "noseLeft", "X": 0.25243401527404785, "Y": 0.5145910382270813}, {"Type": "noseRight", "X": 0.28085580468177795, "Y": 0.4972332715988159}, {"Type": "mouthUp", "X": 0.27561885118484497, "Y": 0.5329715609550476}, {"Type": "mouthDown", "X": 0.28394615650177, "Y": 0.5653430223464966}, {"Type": "leftPupil", "X": 0.20133039355278015, "Y": 0.4523984491825104}, {"Type": "rightPupil", "X": 0.28129422664642334, "Y": 0.4087912440299988}, {"Type": "upperJawlineLeft", "X": 0.1311698704957962, "Y": 0.46898868680000305}, {"Type": "midJawlineLeft", "X": 0.18856483697891235, "Y": 0.5825732350349426}, {"Type": "chinBottom", "X": 0.2962130606174469, "Y": 0.6203031539916992}, {"Type": "midJawlineRight", "X": 0.33180156350135803, "Y": 0.5042592883110046}, {"Type": "upperJawlineRight", "X": 0.30957236886024475, "Y": 0.37158241868019104}], "Pose": {"Roll": -23.102828979492188, "Yaw": 3.1219544410705566, "Pitch": -3.5442771911621094}, "Quality": {"Brightness": 76.52424621582031, "Sharpness": 96.61495208740234}, "Confidence": 99.99998474121094}, {"BoundingBox": {"Width": 0.1537969559431076, "Height": 0.27064284682273865, "Left": 0.700599193572998, "Top": 0.17026177048683167}, "AgeRange": {"Low": 48, "High": 68}, "Smile": {"Value": true, "Confidence": 76.73896789550781}, "Eyeglasses": {"Value": false, "Confidence": 88.32019805908203}, "Sunglasses": {"Value": false, "Confidence": 97.24940490722656}, "Gender": {"Value": "Male", "Confidence": 99.2653579711914}, "Beard": {"Value": false, "Confidence": 87.09922790527344}, "Mustache": {"Value": false, "Confidence": 99.34098815917969}, "EyesOpen": {"Value": true, "Confidence": 99.93042755126953}, "MouthOpen": {"Value": true, "Confidence": 83.3313980102539}, "Emotions": [{"Type": "DISGUSTED", "Confidence": 2.652924060821533}, {"Type": "CALM", "Confidence": 9.28744125366211}, {"Type": "SAD", "Confidence": 3.2358903884887695}, {"Type": "SURPRISED", "Confidence": 7.827535152435303}, {"Type": "HAPPY", "Confidence": 69.06285095214844}, {"Type": "CONFUSED", "Confidence": 5.798086643218994}, {"Type": "ANGRY", "Confidence": 2.135272741317749}], "Landmarks": [{"Type": "eyeLeft", "X": 0.7253099679946899, "Y": 0.2848934233188629}, {"Type": "eyeRight", "X": 0.7882346510887146, "Y": 0.26943516731262207}, {"Type": "mouthLeft", "X": 0.7452651262283325, "Y": 0.3746360242366791}, {"Type": "mouthRight", "X": 0.7972681522369385, "Y": 0.3620894253253937}, {"Type": "nose", "X": 0.7582045197486877, "Y": 0.3277147710323334}, {"Type": "leftEyeBrowLeft", "X": 0.7002695202827454, "Y": 0.26892876625061035}, {"Type": "leftEyeBrowRight", "X": 0.7316190004348755, "Y": 0.25571879744529724}, {"Type": "leftEyeBrowUp", "X": 0.714163601398468, "Y": 0.25501909852027893}, {"Type": "rightEyeBrowLeft", "X": 0.7685369253158569, "Y": 0.24632084369659424}, {"Type": "rightEyeBrowRight", "X": 0.812128484249115, "Y": 0.2415061891078949}, {"Type": "rightEyeBrowUp", "X": 0.787868857383728, "Y": 0.23653507232666016}, {"Type": "leftEyeLeft", "X": 0.7158089876174927, "Y": 0.2861402630805969}, {"Type": "leftEyeRight", "X": 0.7383458614349365, "Y": 0.281990110874176}, {"Type": "leftEyeUp", "X": 0.7247799038887024, "Y": 0.28006812930107117}, {"Type": "leftEyeDown", "X": 0.7267125844955444, "Y": 0.2880774736404419}, {"Type": "rightEyeLeft", "X": 0.7757328748703003, "Y": 0.27263185381889343}, {"Type": "rightEyeRight", "X": 0.7996259331703186, "Y": 0.2653029263019562}, {"Type": "rightEyeUp", "X": 0.7869282960891724, "Y": 0.26458436250686646}, {"Type": "rightEyeDown", "X": 0.7880036234855652, "Y": 0.2728675901889801}, {"Type": "noseLeft", "X": 0.7515624761581421, "Y": 0.3401409983634949}, {"Type": "noseRight", "X": 0.7753664255142212, "Y": 0.3328358829021454}, {"Type": "mouthUp", "X": 0.7662389278411865, "Y": 0.35781601071357727}, {"Type": "mouthDown", "X": 0.7714887857437134, "Y": 0.3842341899871826}, {"Type": "leftPupil", "X": 0.7253099679946899, "Y": 0.2848934233188629}, {"Type": "rightPupil", "X": 0.7882346510887146, "Y": 0.26943516731262207}, {"Type": "upperJawlineLeft", "X": 0.6985645890235901, "Y": 0.2904370427131653}, {"Type": "midJawlineLeft", "X": 0.7255792617797852, "Y": 0.38543701171875}, {"Type": "chinBottom", "X": 0.7816726565361023, "Y": 0.4296976625919342}, {"Type": "midJawlineRight", "X": 0.8388493061065674, "Y": 0.3573923707008362}, {"Type": "upperJawlineRight", "X": 0.8395764827728271, "Y": 0.2554771900177002}], "Pose": {"Roll": -15.45954704284668, "Yaw": -22.94147300720215, "Pitch": 1.8358955383300781}, "Quality": {"Brightness": 81.80601501464844, "Sharpness": 67.22731018066406}, "Confidence": 100.0}, {"BoundingBox": {"Width": 0.1318165361881256, "Height": 0.2411908209323883, "Left": 0.3859011232852936, "Top": 0.23061266541481018}, "AgeRange": {"Low": 35, "High": 52}, "Smile": {"Value": true, "Confidence": 95.98809814453125}, "Eyeglasses": {"Value": false, "Confidence": 99.22638702392578}, "Sunglasses": {"Value": false, "Confidence": 99.9509048461914}, "Gender": {"Value": "Male", "Confidence": 99.8205795288086}, "Beard": {"Value": false, "Confidence": 99.55491638183594}, "Mustache": {"Value": false, "Confidence": 99.98772430419922}, "EyesOpen": {"Value": true, "Confidence": 99.98260498046875}, "MouthOpen": {"Value": false, "Confidence": 97.35255432128906}, "Emotions": [{"Type": "HAPPY", "Confidence": 65.48389434814453}, {"Type": "ANGRY", "Confidence": 1.8191800117492676}, {"Type": "CONFUSED", "Confidence": 1.5404573678970337}, {"Type": "CALM", "Confidence": 22.578277587890625}, {"Type": "SURPRISED", "Confidence": 1.6822370290756226}, {"Type": "SAD", "Confidence": 1.8240364789962769}, {"Type": "DISGUSTED", "Confidence": 5.071920394897461}], "Landmarks": [{"Type": "eyeLeft", "X": 0.41944846510887146, "Y": 0.3230561912059784}, {"Type": "eyeRight", "X": 0.4784352481365204, "Y": 0.3221887946128845}, {"Type": "mouthLeft", "X": 0.42567890882492065, "Y": 0.4034501314163208}, {"Type": "mouthRight", "X": 0.4747196137905121, "Y": 0.40266478061676025}, {"Type": "nose", "X": 0.45356547832489014, "Y": 0.36987295746803284}, {"Type": "leftEyeBrowLeft", "X": 0.3953215479850769, "Y": 0.3032199442386627}, {"Type": "leftEyeBrowRight", "X": 0.43288755416870117, "Y": 0.3006165623664856}, {"Type": "leftEyeBrowUp", "X": 0.4148208498954773, "Y": 0.29563677310943604}, {"Type": "rightEyeBrowLeft", "X": 0.4674118459224701, "Y": 0.3002321422100067}, {"Type": "rightEyeBrowRight", "X": 0.4999593496322632, "Y": 0.301784873008728}, {"Type": "rightEyeBrowUp", "X": 0.4841403067111969, "Y": 0.2949654757976532}, {"Type": "leftEyeLeft", "X": 0.408809095621109, "Y": 0.321848601102829}, {"Type": "leftEyeRight", "X": 0.4310573935508728, "Y": 0.32314229011535645}, {"Type": "leftEyeUp", "X": 0.4196675717830658, "Y": 0.319062739610672}, {"Type": "leftEyeDown", "X": 0.4200402796268463, "Y": 0.32627660036087036}, {"Type": "rightEyeLeft", "X": 0.46596455574035645, "Y": 0.32256847620010376}, {"Type": "rightEyeRight", "X": 0.4870268702507019, "Y": 0.3204285204410553}, {"Type": "rightEyeUp", "X": 0.4776625633239746, "Y": 0.318028062582016}, {"Type": "rightEyeDown", "X": 0.4772416353225708, "Y": 0.3252185583114624}, {"Type": "noseLeft", "X": 0.44026610255241394, "Y": 0.3768109381198883}, {"Type": "noseRight", "X": 0.461662620306015, "Y": 0.3757146894931793}, {"Type": "mouthUp", "X": 0.451613187789917, "Y": 0.39584681391716003}, {"Type": "mouthDown", "X": 0.45127174258232117, "Y": 0.4191305339336395}, {"Type": "leftPupil", "X": 0.41944846510887146, "Y": 0.3230561912059784}, {"Type": "rightPupil", "X": 0.4784352481365204, "Y": 0.3221887946128845}, {"Type": "upperJawlineLeft", "X": 0.37512674927711487, "Y": 0.31603309512138367}, {"Type": "midJawlineLeft", "X": 0.3905247747898102, "Y": 0.40460944175720215}, {"Type": "chinBottom", "X": 0.44983744621276855, "Y": 0.4589351415634155}, {"Type": "midJawlineRight", "X": 0.4960060715675354, "Y": 0.4026068449020386}, {"Type": "upperJawlineRight", "X": 0.5064978003501892, "Y": 0.3135608434677124}], "Pose": {"Roll": -5.339792728424072, "Yaw": 9.509183883666992, "Pitch": -21.126737594604492}, "Quality": {"Brightness": 72.04667663574219, "Sharpness": 38.89601135253906}, "Confidence": 99.9999771118164}], "ResponseMetadata": {"RequestId": "9d3f8c87-3d01-11e9-9c40-e19b32f71e69", "HTTPStatusCode": 200, "HTTPHeaders": {"content-type": "application/x-amz-json-1.1", "date": "Sat, 02 Mar 2019 15:41:24 GMT", "x-amzn-requestid": "9d3f8c87-3d01-11e9-9c40-e19b32f71e69", "content-length": "9832", "connection": "keep-alive"}, "RetryAttempts": 0}}, {"FaceDetails": [{"BoundingBox": {"Width": 0.16110964119434357, "Height": 0.4066687524318695, "Left": 0.4732462763786316, "Top": 0.06378409266471863}, "AgeRange": {"Low": 38, "High": 57}, "Smile": {"Value": false, "Confidence": 95.08674621582031}, "Eyeglasses": {"Value": false, "Confidence": 99.76668548583984}, "Sunglasses": {"Value": false, "Confidence": 99.9710693359375}, "Gender": {"Value": "Male", "Confidence": 99.97423553466797}, "Beard": {"Value": false, "Confidence": 96.82211303710938}, "Mustache": {"Value": false, "Confidence": 99.53077697753906}, "EyesOpen": {"Value": true, "Confidence": 99.93385314941406}, "MouthOpen": {"Value": true, "Confidence": 52.13652420043945}, "Emotions": [{"Type": "CONFUSED", "Confidence": 13.049565315246582}, {"Type": "SURPRISED", "Confidence": 7.4087677001953125}, {"Type": "ANGRY", "Confidence": 10.904327392578125}, {"Type": "CALM", "Confidence": 50.10045623779297}, {"Type": "SAD", "Confidence": 4.085688591003418}, {"Type": "HAPPY", "Confidence": 5.479581356048584}, {"Type": "DISGUSTED", "Confidence": 8.971609115600586}], "Landmarks": [{"Type": "eyeLeft", "X": 0.5226590037345886, "Y": 0.23664331436157227}, {"Type": "eyeRight", "X": 0.5930064916610718, "Y": 0.2399037629365921}, {"Type": "mouthLeft", "X": 0.5278476476669312, "Y": 0.3720378577709198}, {"Type": "mouthRight", "X": 0.5857341289520264, "Y": 0.3747231662273407}, {"Type": "nose", "X": 0.558660626411438, "Y": 0.3006129264831543}, {"Type": "leftEyeBrowLeft", "X": 0.49515247344970703, "Y": 0.20678730309009552}, {"Type": "leftEyeBrowRight", "X": 0.5379547476768494, "Y": 0.19359195232391357}, {"Type": "leftEyeBrowUp", "X": 0.5170059204101562, "Y": 0.18752340972423553}, {"Type": "rightEyeBrowLeft", "X": 0.5794066786766052, "Y": 0.19551073014736176}, {"Type": "rightEyeBrowRight", "X": 0.6207199692726135, "Y": 0.21323347091674805}, {"Type": "rightEyeBrowUp", "X": 0.6003080010414124, "Y": 0.19136571884155273}, {"Type": "leftEyeLeft", "X": 0.5103254914283752, "Y": 0.23596635460853577}, {"Type": "leftEyeRight", "X": 0.5364647507667542, "Y": 0.23762133717536926}, {"Type": "leftEyeUp", "X": 0.5227619409561157, "Y": 0.22903408110141754}, {"Type": "leftEyeDown", "X": 0.5231262445449829, "Y": 0.2415272444486618}, {"Type": "rightEyeLeft", "X": 0.5783576965332031, "Y": 0.23941685259342194}, {"Type": "rightEyeRight", "X": 0.6040977239608765, "Y": 0.239893838763237}, {"Type": "rightEyeUp", "X": 0.5923039317131042, "Y": 0.2319520115852356}, {"Type": "rightEyeDown", "X": 0.5916610360145569, "Y": 0.24438710510730743}, {"Type": "noseLeft", "X": 0.5443762540817261, "Y": 0.32104259729385376}, {"Type": "noseRight", "X": 0.5703396201133728, "Y": 0.3212922215461731}, {"Type": "mouthUp", "X": 0.5571762323379517, "Y": 0.3518644869327545}, {"Type": "mouthDown", "X": 0.5566115975379944, "Y": 0.3930496573448181}, {"Type": "leftPupil", "X": 0.5226590037345886, "Y": 0.23664331436157227}, {"Type": "rightPupil", "X": 0.5930064916610718, "Y": 0.2399037629365921}, {"Type": "upperJawlineLeft", "X": 0.4756912589073181, "Y": 0.25191786885261536}, {"Type": "midJawlineLeft", "X": 0.49034470319747925, "Y": 0.39536431431770325}, {"Type": "chinBottom", "X": 0.555219829082489, "Y": 0.4668028652667999}, {"Type": "midJawlineRight", "X": 0.6172540783882141, "Y": 0.40070781111717224}, {"Type": "upperJawlineRight", "X": 0.6337196230888367, "Y": 0.2585814893245697}], "Pose": {"Roll": 0.5381349325180054, "Yaw": -0.6528982520103455, "Pitch": 2.158910036087036}, "Quality": {"Brightness": 80.66212463378906, "Sharpness": 98.564208984375}, "Confidence": 99.9999771118164}], "ResponseMetadata": {"RequestId": "a318487b-3d01-11e9-b36e-f10cf0f18a2c", "HTTPStatusCode": 200, "HTTPHeaders": {"content-type": "application/x-amz-json-1.1", "date": "Sat, 02 Mar 2019 15:41:27 GMT", "x-amzn-requestid": "a318487b-3d01-11e9-b36e-f10cf0f18a2c", "content-length": "3295", "connection": "keep-alive"}, "RetryAttempts": 0}}, {"FaceDetails": [{"BoundingBox": {"Width": 0.12157949060201645, "Height": 0.22225584089756012, "Left": 0.5969290733337402, "Top": 0.26827237010002136}, "AgeRange": {"Low": 35, "High": 52}, "Smile": {"Value": false, "Confidence": 97.03712463378906}, "Eyeglasses": {"Value": false, "Confidence": 97.33328247070312}, "Sunglasses": {"Value": false, "Confidence": 98.98900604248047}, "Gender": {"Value": "Male", "Confidence": 86.90740203857422}, "Beard": {"Value": false, "Confidence": 99.7890625}, "Mustache": {"Value": false, "Confidence": 99.93164825439453}, "EyesOpen": {"Value": true, "Confidence": 99.96533966064453}, "MouthOpen": {"Value": false, "Confidence": 79.2419662475586}, "Emotions": [{"Type": "SAD", "Confidence": 0.2768668830394745}, {"Type": "ANGRY", "Confidence": 0.23881806433200836}, {"Type": "CONFUSED", "Confidence": 0.30120599269866943}, {"Type": "HAPPY", "Confidence": 0.4117610454559326}, {"Type": "DISGUSTED", "Confidence": 0.2787622809410095}, {"Type": "SURPRISED", "Confidence": 0.33253252506256104}, {"Type": "CALM", "Confidence": 98.16004180908203}], "Landmarks": [{"Type": "eyeLeft", "X": 0.6127297878265381, "Y": 0.3516797125339508}, {"Type": "eyeRight", "X": 0.6606070399284363, "Y": 0.345425546169281}, {"Type": "mouthLeft", "X": 0.6201810836791992, "Y": 0.43409913778305054}, {"Type": "mouthRight", "X": 0.6595476865768433, "Y": 0.42902708053588867}, {"Type": "nose", "X": 0.6287432909011841, "Y": 0.3898276090621948}, {"Type": "leftEyeBrowLeft", "X": 0.5969603657722473, "Y": 0.3356681168079376}, {"Type": "leftEyeBrowRight", "X": 0.617724597454071, "Y": 0.32510149478912354}, {"Type": "leftEyeBrowUp", "X": 0.6058049201965332, "Y": 0.32330653071403503}, {"Type": "rightEyeBrowLeft", "X": 0.6459599137306213, "Y": 0.3210495710372925}, {"Type": "rightEyeBrowRight", "X": 0.6823827624320984, "Y": 0.3249741792678833}, {"Type": "rightEyeBrowUp", "X": 0.6620894074440002, "Y": 0.31547459959983826}, {"Type": "leftEyeLeft", "X": 0.6063716411590576, "Y": 0.3520885407924652}, {"Type": "leftEyeRight", "X": 0.6227648854255676, "Y": 0.3508143126964569}, {"Type": "leftEyeUp", "X": 0.6125369071960449, "Y": 0.34714797139167786}, {"Type": "leftEyeDown", "X": 0.6135199069976807, "Y": 0.3545454144477844}, {"Type": "rightEyeLeft", "X": 0.6513416171073914, "Y": 0.3472004532814026}, {"Type": "rightEyeRight", "X": 0.6704190373420715, "Y": 0.3442919850349426}, {"Type": "rightEyeUp", "X": 0.6600420475006104, "Y": 0.34132593870162964}, {"Type": "rightEyeDown", "X": 0.6603505611419678, "Y": 0.34890443086624146}, {"Type": "noseLeft", "X": 0.6255649924278259, "Y": 0.4023902118206024}, {"Type": "noseRight", "X": 0.6445217132568359, "Y": 0.3987780809402466}, {"Type": "mouthUp", "X": 0.6350691318511963, "Y": 0.4191665053367615}, {"Type": "mouthDown", "X": 0.6376833319664001, "Y": 0.4437447190284729}, {"Type": "leftPupil", "X": 0.6127297878265381, "Y": 0.3516797125339508}, {"Type": "rightPupil", "X": 0.6606070399284363, "Y": 0.345425546169281}, {"Type": "upperJawlineLeft", "X": 0.6019493341445923, "Y": 0.36010244488716125}, {"Type": "midJawlineLeft", "X": 0.6132790446281433, "Y": 0.445656418800354}, {"Type": "chinBottom", "X": 0.6443485021591187, "Y": 0.48649710416793823}, {"Type": "midJawlineRight", "X": 0.6998758316040039, "Y": 0.435406357049942}, {"Type": "upperJawlineRight", "X": 0.7097098231315613, "Y": 0.3471706807613373}], "Pose": {"Roll": -7.93905782699585, "Yaw": -28.08501625061035, "Pitch": 3.437983274459839}, "Quality": {"Brightness": 88.56324768066406, "Sharpness": 73.32209777832031}, "Confidence": 100.0}, {"BoundingBox": {"Width": 0.10505633801221848, "Height": 0.1938968300819397, "Left": 0.3035721182823181, "Top": 0.17239616811275482}, "AgeRange": {"Low": 60, "High": 90}, "Smile": {"Value": true, "Confidence": 50.207923889160156}, "Eyeglasses": {"Value": false, "Confidence": 99.97101593017578}, "Sunglasses": {"Value": false, "Confidence": 99.99847412109375}, "Gender": {"Value": "Male", "Confidence": 79.95903778076172}, "Beard": {"Value": false, "Confidence": 99.57939147949219}, "Mustache": {"Value": false, "Confidence": 99.91566467285156}, "EyesOpen": {"Value": true, "Confidence": 99.19813537597656}, "MouthOpen": {"Value": false, "Confidence": 93.99513244628906}, "Emotions": [{"Type": "SURPRISED", "Confidence": 0.8889885544776917}, {"Type": "DISGUSTED", "Confidence": 81.1180191040039}, {"Type": "SAD", "Confidence": 2.932729482650757}, {"Type": "ANGRY", "Confidence": 7.204898357391357}, {"Type": "HAPPY", "Confidence": 0.8141065239906311}, {"Type": "CONFUSED", "Confidence": 4.733889579772949}, {"Type": "CALM", "Confidence": 2.3073620796203613}], "Landmarks": [{"Type": "eyeLeft", "X": 0.3351894021034241, "Y": 0.24206916987895966}, {"Type": "eyeRight", "X": 0.38122257590293884, "Y": 0.24203678965568542}, {"Type": "mouthLeft", "X": 0.3397219479084015, "Y": 0.3142045736312866}, {"Type": "mouthRight", "X": 0.37793564796447754, "Y": 0.3142860531806946}, {"Type": "nose", "X": 0.3587591052055359, "Y": 0.28005215525627136}, {"Type": "leftEyeBrowLeft", "X": 0.3171897828578949, "Y": 0.2259049415588379}, {"Type": "leftEyeBrowRight", "X": 0.3445826768875122, "Y": 0.22046631574630737}, {"Type": "leftEyeBrowUp", "X": 0.3310260772705078, "Y": 0.21706053614616394}, {"Type": "rightEyeBrowLeft", "X": 0.37164372205734253, "Y": 0.2204570472240448}, {"Type": "rightEyeBrowRight", "X": 0.39908063411712646, "Y": 0.22559848427772522}, {"Type": "rightEyeBrowUp", "X": 0.38528972864151, "Y": 0.21679161489009857}, {"Type": "leftEyeLeft", "X": 0.3271796703338623, "Y": 0.24188223481178284}, {"Type": "leftEyeRight", "X": 0.3441488444805145, "Y": 0.24272200465202332}, {"Type": "leftEyeUp", "X": 0.3351377844810486, "Y": 0.2386384755373001}, {"Type": "leftEyeDown", "X": 0.33548563718795776, "Y": 0.24523283541202545}, {"Type": "rightEyeLeft", "X": 0.37144336104393005, "Y": 0.24262385070323944}, {"Type": "rightEyeRight", "X": 0.38828518986701965, "Y": 0.24162626266479492}, {"Type": "rightEyeUp", "X": 0.380459725856781, "Y": 0.23845690488815308}, {"Type": "rightEyeDown", "X": 0.3801659643650055, "Y": 0.24504829943180084}, {"Type": "noseLeft", "X": 0.3499566912651062, "Y": 0.28865933418273926}, {"Type": "noseRight", "X": 0.3668045699596405, "Y": 0.28837376832962036}, {"Type": "mouthUp", "X": 0.3584822416305542, "Y": 0.3056444823741913}, {"Type": "mouthDown", "X": 0.3585208058357239, "Y": 0.32728269696235657}, {"Type": "leftPupil", "X": 0.3351894021034241, "Y": 0.24206916987895966}, {"Type": "rightPupil", "X": 0.38122257590293884, "Y": 0.24203678965568542}, {"Type": "upperJawlineLeft", "X": 0.3056868016719818, "Y": 0.2443009316921234}, {"Type": "midJawlineLeft", "X": 0.3164883553981781, "Y": 0.3220917284488678}, {"Type": "chinBottom", "X": 0.35856592655181885, "Y": 0.36487478017807007}, {"Type": "midJawlineRight", "X": 0.3988196551799774, "Y": 0.3215474784374237}, {"Type": "upperJawlineRight", "X": 0.4082220494747162, "Y": 0.2436332404613495}], "Pose": {"Roll": -1.2409803867340088, "Yaw": 0.2189350128173828, "Pitch": -8.66206169128418}, "Quality": {"Brightness": 86.30223083496094, "Sharpness": 83.14741516113281}, "Confidence": 99.99998474121094}], "ResponseMetadata": {"RequestId": "a5516fe5-3d01-11e9-b490-3ff25f4cb1a2", "HTTPStatusCode": 200, "HTTPHeaders": {"content-type": "application/x-amz-json-1.1", "date": "Sat, 02 Mar 2019 15:41:29 GMT", "x-amzn-requestid": "a5516fe5-3d01-11e9-b490-3ff25f4cb1a2", "content-length": "6566", "connection": "keep-alive"}, "RetryAttempts": 0}}]
29
30with open('face_final.json') as json_data:
31data = json.loads(json_data.read())
32for d in data:
33 face_details = json_normalize(data=d['FaceDetails'], meta=['AgeRange', 'Gender'])