CI =& get_instance(); $this->s3_properties = array('region'=>'ap-south-1','version'=>'latest','credentials' => array( 'key' =>'AKIAR7TQUR2JRVZMMGLC', 'secret' => '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' )); $this->RekognitionClient = RekognitionClient::factory($this->s3_properties); //print_r($this->s3_properties); // echo "Called"; // $this->setCors('lender8'); // die(); } public function yyy() { echo "listAllBuckets"; } public function comparePhotos($url1,$url2) { // echo "listAllBuckets"; $result = null; $sourceImg = 'will1.jpg'; $targetImg = 'will2.jpg'; //echo $url1;die(); try{ $result = $this->RekognitionClient->compareFaces([ // 'QualityFilter' => 'NONE|AUTO|LOW|MEDIUM|HIGH', 'QualityFilter' => 'NONE', 'SimilarityThreshold' => 0, 'SourceImage' => [ // REQUIRED 'Bytes' => file_get_contents($url1), // 'S3Object' => [ // 'Bucket' => 'awsrekonition', // 'Name' => $sourceImg, // 'Version' => 'any',], // ], 'TargetImage' => [ // REQUIRED 'Bytes' => file_get_contents($url2), // 'S3Object' => [ // 'Bucket' => 'awsrekonition', // 'Name' => $targetImg, // 'Version' => 'any', // ], ], ]); } catch(AwsException $e){ print_r($e->getMessage()); //echo "ex"; // echo "\n"; . die(); } return $result; } public function detectFaces($imgurl) { $result = null; try { $result = $this->RekognitionClient->detectFaces([ 'Attributes' => ["DEFAULT"], 'Image' => [ // REQUIRED 'Bytes' => file_get_contents($imgurl), // 'S3Object' => [ // 'Bucket' => '', // 'Name' => '', // 'Version' => '', // ], ], ]); } catch(AwsException $e) { print_r($e->getMessage()); //echo "ex"; // echo "\n"; . die(); } return $result; } } ?>