(path, scale=1.)
| 200 | |
| 201 | |
| 202 | def load_image(path, scale=1.): |
| 203 | image = Image.open(path) |
| 204 | if scale != 1.: |
| 205 | width, height = image.size |
| 206 | target_shape = (int(width * scale), int(height * scale)) |
| 207 | image = image.resize(target_shape, Image.NEAREST) |
| 208 | |
| 209 | return np.array(image) |
| 210 | |
| 211 | def precision_at_one(pred, target, ignore_label=255): |
| 212 | """Computes the precision@k for the specified values of k""" |
nothing calls this directly
no outgoing calls
no test coverage detected