(image, label, preproc_methods=['flip'])
| 5 | |
| 6 | |
| 7 | def preproc(image, label, preproc_methods=['flip']): |
| 8 | if 'flip' in preproc_methods: |
| 9 | image, label = cv_random_flip(image, label) |
| 10 | if 'crop' in preproc_methods: |
| 11 | image, label = random_crop(image, label) |
| 12 | if 'rotate' in preproc_methods: |
| 13 | image, label = random_rotate(image, label) |
| 14 | if 'enhance' in preproc_methods: |
| 15 | image = color_enhance(image) |
| 16 | if 'pepper' in preproc_methods: |
| 17 | label = random_pepper(label) |
| 18 | return image, label |
| 19 | |
| 20 | |
| 21 | def cv_random_flip(img, label): |
no test coverage detected