-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove albumentations #1136
Comments
Yes, in the current setup that would work. But there are other augmentations, like CoarseDropout for example, which might be quite useful (one can play with them here: https://demo.albumentations.ai/). However, they might be easy to generate with |
Hello I am trying to train in a Nvidia Jetson AGX Xavier,
Is there a reason why albumentations is needed? I need guidance to know if I can to try to use opencv version. import cv2
import logging
from cv2 import GaussianBlur
from cv2 import addWeighted
import numpy as np
from donkeycar.config import Config
logger = logging.getLogger(__name__)
class ImageAugmentation:
def __init__(self, cfg, key, prob=0.5, always_apply=False):
aug_list = getattr(cfg, key, [])
self.augmentations = [ImageAugmentation.create(a, cfg, prob, always_apply) for a in aug_list]
@classmethod
def create(cls, aug_type: str, config: Config, prob, always) -> callable:
""" Augmentation factory."""
if aug_type == 'BRIGHTNESS':
b_limit = getattr(config, 'AUG_BRIGHTNESS_RANGE', 0.2)
logger.info(f'Creating augmentation {aug_type} {b_limit}')
bightness = np.random.uniform(-b_limit, b_limit)
return lambda img_arr: addWeighted(img_arr, 1.0 + bightness, img_arr, 0, 0)
elif aug_type == 'BLUR':
b_range = getattr(config, 'AUG_BLUR_RANGE', (0,3))
logger.info(f'Creating augmentation {aug_type} {b_range}')
bur_intensity = np.random.uniform(b_range[0], b_range[1])
return lambda img_arr: GaussianBlur(img_arr, (13,13), bur_intensity)
# Parts interface
def run(self, img_arr):
for augmentation in self.augmentations:
img_arr = augmentation(img_arr)
return img_arr |
Little update, I was able to train. After committing the above update on my Jetson. |
Albumentations still has the problem on jetson nano that it causes a crash because underneath it still uses a dependency that installs opencv-headless.
The reality is that we only use two augmentations from it; a brightness augmentation and a guassian blur. These are both easily implemented with opencv.
Replace the brightness augmentation and the guassian blur augmentation in
donkeycar/donkeycar/pipeline/augmentations.py
Line 13 in 1398eec
The text was updated successfully, but these errors were encountered: