Repo for the workshop part of the Australian Centre for Robotic Vision Summer School RVSS2019
Use on_robot/collect_data/collect.py for collecting images. Robot control:
- Direction is defined by speed of left and right wheels:
ppi.set_velocity(left, right). - General speed is set in
Kdparameter,Kadefines how much speed is changed when robot is turning. - Press up to go straight:
left = right = Kd. - Press right to turn right:
left += Ka; right -= Ka. - Press left to turn left:
left -= Ka; right += Ka. - When turning in the opposite direction, speed is first reset to
Kd. - Press space to stop:
ppi.set_velocity(0, 0).
Images are saved to on_robot/collect_data/data. Image naming example: 000001_18_14.jpg, where 000001 - image id, 18 - speed of the left wheel, 14 - speed of the right wheel.
-
Put all the collected data in folders
dataset1,dataset2, etc (no more than 999 images per folder or there'll be problems with names). -
Use
rename.pyto rename all images and put them to processed_data folder. The new naming: 010001_right2.jpg, where first two digits (01) identify dataset folder, las 4 digits (0001) - image id, string (right2) - type of turn. -
Use
split_by_turn.pyto split the images to different folders according to the type of turn. -
Use
data_augmentation.pyto mirror the images. If 3rd digit in image id is '1' then image was mirrored. (Ex: 030001_right1.jpg - original image; 031001_left1.jpg - mirrored image.) -
Use
delete.pyto cut down the number of images (for class balance). -
Use
create_dataset.pyto split images into training and validation sets, so that data for each turn is splitted 70/30. -
Move
train_dataandval_datafolders toon_laptop/dev_data.
on_laptop/steer_net/steerDS.pycontainsSteerDataSetclass for loading (image, label) dataset instances.on_laptop/steer_net/steerNet.pycontainssteerNetnetwork with following architecture:
on_laptop/steer_net/train_model.pycontains functiontrain_modelthat performs training and validation steps and saves the model that achieves the best accuracy on validation data.- Run
on_laptop/train.pyto train the model. Output directory for model weights and information files ison_laptop/trained_models/{random number}.
- Move model file
steerNet.pyand model weightssteerNet.pttoon_robot/deploy. - Run
on_robot/deploy/deploy0.py.