People/Face Detection and Recognition

From RobotForAll
Jump to: navigation, search

dlib face detection

install dlib

$ sudo pip install dlib

to test if you have successfully install python module of dlib, opne a terminal

$ python
$ import dlib

it there is no error that's ok

To run the code in this tutorial, you need first download the package. https://github.com/hutslib/rchome_tutorial Put robocup_vision_tutorial package in your catkin_ws.

$ cd ~/catkin_ws
$ catkin_make
$ cd ~/catkin_ws/src/vision_test/src

in this folder, you can find a scripts named dlib_detection.py, change the image path and result path

$ python dlib_detection.py

if you want to use this function in your task, annotate the main function and create the class object in your code just as the example in main now. if you want to learn more about dlib, you can also add function in the class and call your own function outside the file.

baidu gender detection

To run the code in this tutorial, you need first download the package. https://github.com/hutslib/rchome_tutorial Put robocup_vision_tutorial package in your catkin_ws.

$ cd ~/catkin_ws
$ catkin_make

In order to run vision detection vis baidu AI, what you need to do is first register in baidu AI. After you have register and log in, you need to register a application based on your need (eg. gender detect) and your need to remember your AK and SK.

$ cd ~/catkin_ws/src/robocup_vision_tutorial/scripts

Your can find a scripts named baidu_gender_detect.py. Your need to change the SK and AK with your own ones. Follow the example in the code.

You also need to change the img_path and result_path in the ‘main’ . Follow the example in the code.

$ python baidu_gender_detect.py

You can see the result in the result_path

if you want to use this function in your task, annotate the main function and create the class object in your code just as the example in main now. if you want to use baidu to do other vision perception, you may need to change the url with the correct ones and you may also need to modify the scripts a little bit according to the specific API.

darknet yolo object detection (deep learning)

This part require your have a computer with a GPU memory more than 2G (if you want to use yolo network).

install opencv from source

install CUDA

install Cudnn

install darknet

label your own dataset

train your dataset

run darknet detect

if you want to use this function in your task, annotate the main function and create the class object in your code just as the example in main now.