update confidence + version

This commit is contained in:
2021-04-23 16:58:19 +07:00
parent 1b1162f3c2
commit b006af4e1f
7 changed files with 63 additions and 12 deletions

View File

@@ -63,7 +63,34 @@ class CaptureLogsGrid {
public static function confidence() {
return function($model) {
return number_format($model->confidence, 2);
$confidence = json_decode($model->confidence, true);
$person1_html = $person2_html = "";
$person1 = \app\models\ListManagement::findOne($confidence['id1']);
if ($person1) {
$images = json_decode($person1->image, true);
$person1_html = "<div class='feature-img'>" . Html::img("/data/uploads/face/" . $images[0]['url'], [
"class" => "img-thumbnail",
"style" => "width: 100px;height:100px;"
]) . "<br>" . $person1->name . " [" . $confidence['percent1'] . "]" . "</div>";
}
if ($confidence['id2'] !== "0" && $confidence['id2'] != $confidence['id1']) {
$person2 = \app\models\ListManagement::findOne($confidence['id2']);
if ($person2) {
$images = json_decode($person2->image, true);
$person2_html = "<div class='feature-img'>" . Html::img("/data/uploads/face/" . $images[0]['url'], [
"class" => "img-thumbnail",
"style" => "width: 100px;height:100px;"
]) . "<br>" . $person2->name . " [" . $confidence['percent2'] . "]" . "</div>";
}
}
return $person1_html . $person2_html;
};
}
public static function confidenceControlLogs() {
return function($model) {
$confidence = json_decode($model->confidence, true);
return $confidence['percent1'] . ($confidence['percent2'] > 0 ? " [" . $confidence['percent2'] . "]" : "");
};
}