Get the regex pattern to match the image quality metric. Note that, although this function is called PSNR, for some images we may choose to match another metric (e.g. mPSNR for HDR images). Args: image: The test image that was compressed. Retur
(self, image: TestImage)
| 168 | return (psnr, total_time, coding_time, coding_rate) |
| 169 | |
| 170 | def get_psnr_pattern(self, image: TestImage) -> re.Pattern: |
| 171 | ''' |
| 172 | Get the regex pattern to match the image quality metric. |
| 173 | |
| 174 | Note that, although this function is called PSNR, for some images we |
| 175 | may choose to match another metric (e.g. mPSNR for HDR images). |
| 176 | |
| 177 | Args: |
| 178 | image: The test image that was compressed. |
| 179 | |
| 180 | Return: |
| 181 | The regex pattern. |
| 182 | ''' |
| 183 | # pylint: disable=unused-argument,redundant-returns-doc |
| 184 | assert False, 'Missing subclass implementation' |
| 185 | return re.compile('^(?!x)x$') |
| 186 | |
| 187 | def get_total_time_pattern(self) -> re.Pattern: |
| 188 | ''' |