Giter VIP home page Giter VIP logo

aoe-khkhan / wasistdasfuer1drone Goto Github PK

View Code? Open in Web Editor NEW

This project forked from magnusja/wasistdasfuer1drone

0.0 1.0 0.0 1.43 MB

WasIstDasFuer1Drone uses OpenCV face recognition (Haar feature-based cascade classifiers) to recognise faces in front of the quadrocopter and then tries to follow a authorized face. After a face was recognised by OpenCV the face is fed into a neural net for classification. The neural net decides if the person is allowed to control the drone or not.

Dockerfile 2.87% Shell 0.70% Python 96.43%

wasistdasfuer1drone's Introduction

WasIstDasFuer1Drone

Introduction

WasIstDasFuer1Drone was developed for the CDTM elective course “Deep Learning Autonomous Drones” in which student teams of two had 5 days to develop a software that could enable a Parrot AR.Drone 2.0 to (semi-) autonomously fly through a parkour. In our implementation, the drone flies through the parkour, which is made out of three small football goals, by recognising and following the developers’ faces.

On the final racing day, Friday the 12th of August 2016, WasIstDasFuer1Drone successfully finished the parkour with mind-numbing speed in only 0:33 minutes. The following documentation is meant to give the reader a short overview of the implemented approach, giving insights into the practical application of computer vision and deep learning and hopefully inspiring future students to develop even better algorithms.

Algorithm and Behaviour

As mentioned above, the core idea behind WasIstDasFuer1Drone is that it should be able to independently detect its creator’s faces so that it can follow them through any given parkour. To accomplish this, an algorithm with three main steps was designed and implemented.

First of all, Haar feature-based cascade classifiers were used to detect and distinguish human faces. The Haar cascade algorithm is a machine learning based object detection method where a cascade function is trained from a lot of positive and negative images. It is then used to detect objects in other images, in this case faces. For WasIstDasFuer1Drone, many functions of the Open Source Computer Vision (OpenCV) library were utilized, including a relatively straightforward and well-performing implementation of the Haar cascade algorithm.

Once the drone can distinguish human faces from the environment, it was important to train it in a way that it only follows authorized faces - in this case the developers’. Using the deep learning framework Caffe, several thousand images of authorized and unauthorized faces were used to train a neural network (AlexNet & ImageNet fine tuning) so that it can distinguish one from the other, even in changing environments with varying backgrounds. The results were far from perfect, as there were still many false classifications, but with extensive tweaking they were integrated in a way that the drone could detect authorized faces in a fairly stable manner. Given more time, a better set of training images could have been collected to achieve much better results.

Finally, having detected an authorized face with a distinct bounding box, the drone now needs to use this geometric information to calculate steering commands. In order to achieve flight in a smooth and precise, a proportional–integral–derivative controller (PID controller) was implemented.

Usage

Dependencies:

  • pygame
  • python-opencv

Start the webserver located in folder webserver/ on localhost or somewhere remote where classification takes place. Then route http traffic via SSH, for instance. A working caffe model you can use to start the server is also in the directory.

Then just start main.py, wait until you get a camera stream and try steering.

Steering

The code allows manual steering at any time. The commands are as follows:

Key Action
RETURN Takeoff
SPACE Land
BACKSPACE Emergency landing (Do not use)
W/A/S/D Forward, backward, left, right
UP/DOWN Fly upwards or downwards
0-9 Drone speed (higher is faster)
u Activate autonomous mode

Please note that these might not work for operating systems other than OS X.

Team

Magnus and Jakob are students at the Center for Digital Technologies (CDTM) and the Technical University Munich (TUM). Both are in their Master’s, with Code-Wizard Magnus majoring in Computer Science and Detection-Face Jakob studying Management & Technology.

wasistdasfuer1drone's People

Contributors

magnusja avatar caprivi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.