Compute stats bar data for a test.
(test)
| 184 | return stats |
| 185 | |
| 186 | def test_stats(test): |
| 187 | ''' |
| 188 | Compute stats bar data for a test. |
| 189 | ''' |
| 190 | total_count = len(test['images']) |
| 191 | if total_count == 0: |
| 192 | return [] |
| 193 | stats = [] |
| 194 | for result, color in zip(['PASSED', 'FAILED'], ['#32b643', '#e85600']): |
| 195 | count = len(list(filter(lambda i: i['success'] == (result == 'PASSED'), test['images']))) |
| 196 | stats.append({ |
| 197 | 'title': result, |
| 198 | 'percentage': round(100 * count / total_count, 1), |
| 199 | 'color': color |
| 200 | }) |
| 201 | return stats |
| 202 | |
| 203 | def create_jeri_data(result_image, ref_image, error_image, extra_metrics=['L1', 'L2', 'MAPE', 'MRSE', 'SMAPE', 'SSIM']): |
| 204 | ''' |