<?php
$string = '1/1 [==============================] - 1s 1s/step
[
{
"image_id": "mahomes1",
"mean_score_prediction": 6.3682564571499825
},
{
"image_id": "mahomes2",
"mean_score_prediction": 6.7501190304756165
},
{
"image_id": "mahomes3",
"mean_score_prediction": 6.3136263862252235
},
]';
$string = preg_replace(array('/^[^\v]+/', '/,(\s+\])/'), array('', '$1'), $string);
$dict = json_decode($string);
print_r($dict);
preferences:
29.01 ms | 406 KiB | 5 Q