Face Compare report Changes 6 : ps
This commit is contained in:
parent
fdf17ee662
commit
7fa2c1e4bd
@ -5803,27 +5803,16 @@ class PD_Controller extends REST_Controller
|
||||
}
|
||||
|
||||
$db_result = $this->PD_Model->selectCustomRecords(array('facecrop'), array('fk_pd_id' => $pdid,'isactive'=>1), PDAPPLICANTSDETAILS);
|
||||
for ($dinx = 0; $dinx < count($db_result); $dinx++) {
|
||||
$string = $db_result[$dinx]['facecrop'];
|
||||
// echo gettype($string);
|
||||
$my_array[$dinx] = json_decode($string, true);
|
||||
$fc_array = array();
|
||||
if(!empty($db_result)){
|
||||
for ($dinx = 0; $dinx < count($db_result); $dinx++) {
|
||||
$string = $db_result[$dinx]['facecrop'];
|
||||
// echo gettype($string);
|
||||
$fc_array[$dinx] = json_decode($string, true);
|
||||
}
|
||||
}
|
||||
$data['facecrop'] = $my_array;
|
||||
// echo gettype($my_array);
|
||||
// print_r($my_array);
|
||||
// if (!empty($my_array) && !empty($my_array["FaceMatches"])) {
|
||||
// $data['faceapi_result'] = $my_array;
|
||||
// $arr = $my_array["FaceMatches"];
|
||||
// log_message('ERROR', "In PD Controller to Make FaceBoundingBox FaceMatches array cnt : " . count($arr));
|
||||
// for ($i = 0; $i < count($arr); $i++) {
|
||||
// $data['bounding_box'][$i] = $arr[$i]['Face']['BoundingBox'];
|
||||
// $data['bounding_box'][$i]['Similarity'] = $arr[$i]['Similarity'];
|
||||
// }
|
||||
// }else{
|
||||
// $data['faceapi_result'] = array();
|
||||
// $data['bounding_box'] = array();
|
||||
// }
|
||||
|
||||
$data['facecrop'] = $fc_array;
|
||||
|
||||
// print_r($data['add_on_pd_images']);
|
||||
// die();
|
||||
|
||||
@ -10542,18 +10531,18 @@ class PD_Controller extends REST_Controller
|
||||
log_message('ERROR', $applicants_details[$j]['applicant_name'] . " Facemark Image Generated : " . $applicants_details[$j]['facemark_image_generated']);
|
||||
$string = $applicants_details[$j]['faceapi_result'];
|
||||
// echo gettype($string);
|
||||
$my_array = json_decode($string, true);
|
||||
// echo gettype($my_array);
|
||||
if (!empty($my_array) && !empty($my_array["FaceMatches"])) {
|
||||
$arr = $my_array["FaceMatches"];
|
||||
$faceapi_result_decode = json_decode($string, true);
|
||||
// echo gettype($faceapi_result_decode);
|
||||
if (!empty($faceapi_result_decode) && !empty($faceapi_result_decode["FaceMatches"])) {
|
||||
$arr = $faceapi_result_decode["FaceMatches"];
|
||||
log_message('ERROR', $applicants_details[$j]['applicant_name'] . " FaceMatched array cnt : " . count($arr));
|
||||
for ($i = 0; $i < count($arr); $i++) {
|
||||
$bounding_box['compare_image'][$i] = $arr[$i]['Face']['BoundingBox'];
|
||||
$bounding_box['compare_image'][$i]['Similarity'] = $arr[$i]['Similarity'];
|
||||
}
|
||||
}
|
||||
if (!empty($my_array) && !empty($my_array["SourceImageFace"])) {
|
||||
$bounding_box['source_image'] = $my_array["SourceImageFace"]['BoundingBox'];
|
||||
if (!empty($faceapi_result_decode) && !empty($faceapi_result_decode["SourceImageFace"])) {
|
||||
$bounding_box['source_image'] = $faceapi_result_decode["SourceImageFace"]['BoundingBox'];
|
||||
}
|
||||
|
||||
$where_condition_array = array('fk_pd_id' => $pdid, 'isactive' => 1,'co_applicant_id'=>$apcntid);
|
||||
|
||||
@ -78,9 +78,11 @@ class faceapi
|
||||
$Similarity_split = explode(".", $Similarity);
|
||||
$Similarity_value = $Similarity_split[0];
|
||||
list($imagewidth, $imageheight) = getimagesize($destination_path);
|
||||
if ($Similarity_value >= 70) { // above 70 green
|
||||
if ($Similarity_value > 80) { // above 81 green
|
||||
$color = imagecolorallocate($img, 0, 153, 0);
|
||||
} else if ($Similarity_value < 70) { // below 70 red
|
||||
} else if ($Similarity_value <= 80 && $Similarity_value > 60) { // in between 61 to 80 orange
|
||||
$color = imagecolorallocate($img, 255, 165, 0);
|
||||
} else if ($Similarity_value <= 60) { // below 60 red
|
||||
$color = imagecolorallocate($img, 255, 0, 0);
|
||||
}
|
||||
$white = imagecolorallocate($img, 255, 255, 255);
|
||||
@ -173,8 +175,10 @@ class faceapi
|
||||
$image_data = file_get_contents($destination_path_2);
|
||||
$base64 = base64_encode($image_data);
|
||||
unlink($destination_path_2);
|
||||
$Similarity_split = explode(".", $Similarity);
|
||||
$Similarity_value = $Similarity_split[0];
|
||||
// if($i === null){
|
||||
return array('name' => $temp_image_name, 'base64' => $base64, 'Similarity' => $Similarity);
|
||||
return array('name' => $temp_image_name, 'base64' => $base64, 'Similarity' => $Similarity_value);
|
||||
// }else{
|
||||
// return array($i => array('name' => $temp_image_name, 'base64' => $base64, 'Similarity' => $Similarity));
|
||||
// }
|
||||
|
||||
@ -8,10 +8,6 @@ $loan_word = $pd_master_details[0]['lender_short_name'] != 'CFPL' ? 'Loan' : 'Fa
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet">
|
||||
<style type="text/css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
@ -768,6 +764,14 @@ if ( isset($pdf) ) {
|
||||
$notequal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>≠</center></span>';
|
||||
$equal_mark ='<span style="font-family: DejaVu Sans; sans-serif;"><center>=</center></span>';
|
||||
for ($i = 0; $i < count($ci); $i++) {
|
||||
$similarity = round($ci[$i]["Similarity"]);
|
||||
if ($similarity > 80) { // above 81 green
|
||||
$progress_bar_class = 'progress-bar progress-bar-success';
|
||||
} else if ($similarity <= 80 && $similarity > 60) { // in between 61 to 80 orange
|
||||
$progress_bar_class = 'progress-bar progress-bar-warning';
|
||||
} else if ($similarity <= 60) { // below 60 red
|
||||
$progress_bar_class = 'progress-bar progress-bar-danger';
|
||||
}
|
||||
$symbol = (round($ci[$i]["Similarity"]) > 50) ? '<center><h1>'.$equal_mark.'</h1></center>': '<center><h1>'.$notequal_mark.'</h1></center>';
|
||||
// echo '<div><div class="facecrop">';
|
||||
// echo '<img src="data:image/png;base64,'. $si["base64"].'" width="50" height="50" alt="'.$si["name"].'" align="left"/>';
|
||||
@ -781,22 +785,22 @@ if ( isset($pdf) ) {
|
||||
// </div>
|
||||
// </div>';
|
||||
echo '<div class="facecrop_row facecrop">
|
||||
<div class="facecrop_column">
|
||||
<img src="data:image/png;base64,'. $si["base64"].'" alt="'.$si["name"].'" width="50" height="50" align="left">
|
||||
</div>
|
||||
<div class="facecrop_column">'.$symbol.'</div>
|
||||
<div class="facecrop_column">
|
||||
<img src="data:image/png;base64,'. $ci[$i]["base64"].'" alt="'.$ci[$i]["name"].'" width="50" height="50" align="right">
|
||||
</div>
|
||||
<div class="facecrop_column">
|
||||
<img src="data:image/png;base64,'. $si["base64"].'" alt="'.$si["name"].'" width="50" height="50" align="left">
|
||||
</div>
|
||||
<div class="facecrop_column">'.$symbol.'</div>
|
||||
<div class="facecrop_column">
|
||||
<img src="data:image/png;base64,'. $ci[$i]["base64"].'" alt="'.$ci[$i]["name"].'" width="50" height="50" align="right">
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
echo '<p style="text-align:left;">Similarity
|
||||
<span style="float:right;">'.round($ci[$i]["Similarity"]).'</span>
|
||||
</p>
|
||||
<div class="progress">
|
||||
<div class="progress-bar" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width:'.round($ci[$i]["Similarity"]).'%">
|
||||
'.round($ci[$i]["Similarity"]).'
|
||||
</div>
|
||||
<span style="float:right;">'.round($ci[$i]["Similarity"]).' %</span>
|
||||
</p>
|
||||
<div class="progress">
|
||||
<div class="'.$progress_bar_class.'" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width:'.round($ci[$i]["Similarity"]).' %">
|
||||
'.round($ci[$i]["Similarity"]).' %
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user