|
1 | 1 | # augmentations from the StrongAugment paper: https://github.com/jopo666/StrongAugment
|
2 | 2 |
|
3 | 3 | import functools
|
4 |
| -from typing import Optional, Union |
| 4 | +from typing import Dict, Optional, Tuple, Union |
5 | 5 |
|
6 | 6 | import cv2
|
7 | 7 | import numpy as np
|
@@ -236,7 +236,7 @@ def _apply_operation(image: np.ndarray, operation_name: str, **kwargs) -> np.nda
|
236 | 236 | return operation_fn(image, **kwargs)
|
237 | 237 |
|
238 | 238 |
|
239 |
| -def _check_augment_space(space: dict[str, tuple[MAGNITUDE, MAGNITUDE]]) -> None: |
| 239 | +def _check_augment_space(space: Dict[str, Tuple[MAGNITUDE, MAGNITUDE]]) -> None: |
240 | 240 | """Check that passed augmentation space is valid."""
|
241 | 241 | if not isinstance(space, dict):
|
242 | 242 | raise TypeError(f"Augment space should be a dict, not {type(space)}")
|
@@ -287,7 +287,7 @@ def _check_operation_bounds(name: str, low: MAGNITUDE, high: MAGNITUDE) -> None:
|
287 | 287 |
|
288 | 288 |
|
289 | 289 | def _magnitude_kwargs(
|
290 |
| - operation_name: str, bounds: tuple[MAGNITUDE, MAGNITUDE], rng: RandomState |
| 290 | + operation_name: str, bounds: Tuple[MAGNITUDE, MAGNITUDE], rng: RandomState |
291 | 291 | ) -> Optional[dict[str, MAGNITUDE]]:
|
292 | 292 | """Generate magnitude kwargs for apply_operations."""
|
293 | 293 | if operation_name == "tone":
|
|
0 commit comments