Skip to content

autorope/donkeycar

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

* moved transformations to cv.py; added colorspace transforms
* add parts for crop and trapeze transformations

* Update training to use new transformations
- image_transformations.py use cv.py parts for transforms
- augmentations2.py remove old transformations
- training.py updated to allow for transformations
  both before and after training augmentation.
- cfg_complete.py added new tranformation config
  and a lot of documentation comments.

* Port albumentations augmentations from Dirk's branch
- replace imgaug with albumentations
- update install to include albumentations

* transforms from gray to color, cvcam resizes
- conversions from grey to BGR and RGB
- fixed CvCam so it will resize the image if
  the camera does not produce the desired size.

* Update deep learning to show inference image
- Now we can show the image used for inference
  when in autopilot mode.  set `SHOW_PILOT_IMAGE`
  to True.

* augmentations use albumentations library
- ported from Dirk's branch
- remove transformations from ImageAugmentation class in favor of new
  transformations in ImageTransformations class

* Can now add a custom image transformation to pipeline
- name the label starting with "CUSTOM", like "CUSTOM_CROP"
- include config to use to get the module and class names.
  these being with the custom label and end with
  "_MODULE" and "_CLASS" respectively, like
  "CUSTOM_CROP_MODULE" and "CUSTOM_CROP_CLASS"
- The custom transformer class must take a Config instance
  in the constructor and must have a run method that
  takes and image and returns an image.

* Change custom transformation loader to use file path
- the prior design did not work for both driving from the
  mycar folder and training (which uses the donkey module)
- the new design dynamically loads the module given it's
  file path and caches it.  As long as the file path
  is either an absolute path then this will work when
  driving or training without changing myconfig.py.
- this design allows more then on custom transformer
  class per file.

* Change imgaug -> albumentations in the UI. Update yaml files to remove opencv-headless which clashes w/ opencv. Unfreeze numpy version.

* Peg numpy to 1.19 in order to be aligned w/ tf 2.2.0 and replace remaining instances of MULTIPLY with BRIGHTNESS.

* Align interface of ImageTransformations with ImageAugmentations to take a config and a string, representing the key of transformations in the config file, and another optional string of post transformations. Update ui to support pre and post transformations.


* version='4.4.dev7'

---------

Co-authored-by: DocGarbanzo <47540921+DocGarbanzo@users.noreply.github.com>
5e234c3

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Donkeycar: a python self driving library

Build Status Lint Status Release

All Contributors Issues Pull Requests Forks Stars License

Discord

Donkeycar is minimalist and modular self driving library for Python. It is developed for hobbyists and students with a focus on allowing fast experimentation and easy community contributions.

Quick Links

donkeycar

Use Donkey if you want to:

  • Make an RC car drive its self.
  • Compete in self driving races like DIY Robocars
  • Experiment with autopilots, mapping computer vision and neural networks.
  • Log sensor data. (images, user inputs, sensor readings)
  • Drive your car via a web or game controller or RC controller.
  • Leverage community contributed driving data.
  • Use existing CAD models for design upgrades.

Get driving.

After building a Donkey2 you can turn on your car and go to http://localhost:8887 to drive.

Modify your cars behavior.

The donkey car is controlled by running a sequence of events

#Define a vehicle to take and record pictures 10 times per second.

import time
from donkeycar import Vehicle
from donkeycar.parts.cv import CvCam
from donkeycar.parts.tub_v2 import TubWriter
V = Vehicle()

IMAGE_W = 160
IMAGE_H = 120
IMAGE_DEPTH = 3

#Add a camera part
cam = CvCam(image_w=IMAGE_W, image_h=IMAGE_H, image_d=IMAGE_DEPTH)
V.add(cam, outputs=['image'], threaded=True)

#warmup camera
while cam.run() is None:
    time.sleep(1)

#add tub part to record images
tub = TubWriter(path='./dat', inputs=['image'], types=['image_array'])
V.add(tub, inputs=['image'], outputs=['num_records'])

#start the drive loop at 10 Hz
V.start(rate_hz=10)

See home page, docs or join the Discord server to learn more.