update lay vecto 512 ngam

This commit is contained in:
2021-01-06 17:38:50 +07:00
parent 3b247f9f25
commit aa811a40dd
5 changed files with 162 additions and 35 deletions

View File

@@ -128,4 +128,28 @@ class ListManagement extends \yii\db\ActiveRecord {
return $f;
}
public static function statisticFeatures() {
$lists = self::find()->all();
$total128 = $total512 = $totalImg = $img = 0;
foreach ($lists as $key => $value) {
$images = json_decode($value->image, true);
if (count($images) > 0)
$totalImg++;
$img += count($images);
foreach ($images as $k => $v) {
if (isset($v['features']) && count($v['features']) > 0)
$total128++;
if (isset($v['features512']) && count($v['features512']) > 0)
$total512++;
}
}
return [
"total" => count($lists),
"totalImg" => $totalImg,
"img" => $img,
"128" => $total128,
"512" => $total512
];
}
}