(image, label, preproc_methods=['flip'])
| 39 | |
| 40 | |
| 41 | def preproc(image, label, preproc_methods=['flip']): |
| 42 | if 'flip' in preproc_methods: |
| 43 | image, label = cv_random_flip(image, label) |
| 44 | if 'crop' in preproc_methods: |
| 45 | image, label = random_crop(image, label) |
| 46 | if 'rotate' in preproc_methods: |
| 47 | image, label = random_rotate(image, label) |
| 48 | if 'enhance' in preproc_methods: |
| 49 | image = color_enhance(image) |
| 50 | if 'pepper' in preproc_methods: |
| 51 | image = random_pepper(image) |
| 52 | return image, label |
| 53 | |
| 54 | |
| 55 | def cv_random_flip(img, label): |
no test coverage detected