How do i parse the KairosSDK JSON recognise response in Swift? -


for don't know kairos sdk is, it's facial recognition api.

when give image, tell if can match in database.

when give image; api sends me response:

[images: (     {     attributes =         {         gender =             {             confidence = "80%";             type = f;         };     };     candidates =         (                     {             "enrollment_timestamp" = 1436883322;             face3rd = "0.988351106643677";         },                     {             "enrollment_timestamp" = 1436883214;             hi = "0.94137054681778";         },                     {             "enrollment_timestamp" = 1436883132;             hi = "0.94137054681778";         }     );     time = "6.43676";     transaction =         {         confidence = "0.988351106643677";         "distance_apart" = "0.046980559825897";         "gallery_name" = test1;         height = 482;         "matching_threshold" = "0.4";         "next_subject" = hi;         "next_subject_confidence" = "0.94137054681778";         "simularity_threshold" = "0.1";         status = success;         subject = face3rd;         topleftx = 148;         toplefty = 92;         width = 482;     }; } )] 

what have done put 3 images in database , have called each of them respectively, face3rd, hi, hi (sorry 2 hi's)

i have been trying parse names , number next soo long, can around 6 second response time.

the reason have not been able names because, can see, don't know tell swift for. image name changes depending on back.

i don't know if i've explained situation, bestly, if @ response. parts say:

face3rd = "0.988351106643677"; hi = "0.94137054681778"; hi = "0.94137054681778"; 

i need information on both sides of equal sign.

thank , apologise, if reading pedantic or felt lot of repetion.

thanks!

yes, poorly formatted json returning. fix in upcoming version of api (no release date @ time..sorry).

if need closest match, can access subject variable directly , ignore candidates array.

otherwise, need parse candidates array manually unfortunately. i'm not sure how in swift.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -