mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 07:06:36 +00:00
remove fog and shadow augmentations
add install script
This commit is contained in:
@@ -8,3 +8,5 @@ models/
|
|||||||
*.onnx
|
*.onnx
|
||||||
*.rknn
|
*.rknn
|
||||||
*.mp4
|
*.mp4
|
||||||
|
venv
|
||||||
|
*.engine
|
||||||
+3
-10
@@ -24,17 +24,10 @@ class Augmentator:
|
|||||||
self.transform = A.Compose([
|
self.transform = A.Compose([
|
||||||
# Flips, rotations and brightness
|
# Flips, rotations and brightness
|
||||||
A.HorizontalFlip(p=0.6),
|
A.HorizontalFlip(p=0.6),
|
||||||
A.RandomBrightnessContrast(p=0.4, brightness_limit=(-0.1, 0.1), contrast_limit=(-0.1, 0.1)),
|
A.RandomBrightnessContrast(p=0.4, brightness_limit=(-0.3, 0.3), contrast_limit=(-0.05, 0.05)),
|
||||||
A.Affine(p=0.7, scale=(0.8, 1.2), rotate=(-20, 20), shear=(-10, 10), translate_percent=0.2),
|
A.Affine(p=0.8, scale=(0.8, 1.2), rotate=(-35, 35), shear=(-10, 10)),
|
||||||
|
|
||||||
# Weather
|
A.MotionBlur(p=0.1, blur_limit=(1, 2)),
|
||||||
A.RandomFog(p=0.3, fog_coef_range=(0, 0.3)),
|
|
||||||
A.RandomShadow(p=0.2),
|
|
||||||
|
|
||||||
# Image Quality/Noise
|
|
||||||
A.MotionBlur(p=0.2, blur_limit=(3, 5)),
|
|
||||||
|
|
||||||
# Color Variations
|
|
||||||
A.HueSaturationValue(p=0.4, hue_shift_limit=10, sat_shift_limit=10, val_shift_limit=10)
|
A.HueSaturationValue(p=0.4, hue_shift_limit=10, sat_shift_limit=10, val_shift_limit=10)
|
||||||
], bbox_params=A.BboxParams(format='yolo'))
|
], bbox_params=A.BboxParams(format='yolo'))
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
echo install python and dependencies
|
||||||
|
if not exist venv (
|
||||||
|
python -m venv venv
|
||||||
|
)
|
||||||
|
|
||||||
|
venv/bin/python -m pip install --upgrade pip
|
||||||
|
venv/bin/pip install -r requirements.txt
|
||||||
|
venv\Scripts\pip install --upgrade pyinstaller pyinstaller-hooks-contrib
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
from augmentation import Augmentator
|
from augmentation import Augmentator
|
||||||
from train import train_dataset, convert2rknn
|
from train import train_dataset, convert2rknn
|
||||||
|
|
||||||
Augmentator().augment_annotations(from_scratch=True)
|
Augmentator().augment_annotations()
|
||||||
train_dataset(from_scratch=True)
|
train_dataset(from_scratch=True)
|
||||||
@@ -38,7 +38,6 @@ DEFAULT_CLASS_NUM = 80
|
|||||||
total_files_copied = 0
|
total_files_copied = 0
|
||||||
|
|
||||||
def form_dataset(from_date: datetime):
|
def form_dataset(from_date: datetime):
|
||||||
|
|
||||||
makedirs(today_dataset, exist_ok=True)
|
makedirs(today_dataset, exist_ok=True)
|
||||||
images = []
|
images = []
|
||||||
old_images = []
|
old_images = []
|
||||||
@@ -180,10 +179,10 @@ def train_dataset(existing_date=None, from_scratch=False):
|
|||||||
cur_folder = f'{prefix}{existing_date}'
|
cur_folder = f'{prefix}{existing_date}'
|
||||||
cur_dataset = path.join(datasets_dir, f'{prefix}{existing_date}')
|
cur_dataset = path.join(datasets_dir, f'{prefix}{existing_date}')
|
||||||
else:
|
else:
|
||||||
if from_scratch:
|
# if from_scratch and Path(today_dataset).exists():
|
||||||
shutil.rmtree(today_dataset)
|
# shutil.rmtree(today_dataset)
|
||||||
form_dataset(latest_date)
|
# form_dataset(latest_date)
|
||||||
create_yaml()
|
# create_yaml()
|
||||||
cur_folder = today_folder
|
cur_folder = today_folder
|
||||||
cur_dataset = today_dataset
|
cur_dataset = today_dataset
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user