GithubHelp home page GithubHelp logo

yehengchen / smartcar Goto Github PK

View Code? Open in Web Editor NEW
18.0 5.0 8.0 38.12 MB

SmartCar - Real-time SmartCar System (Driver/Passenger) which included Face ID Recognition and Head Pose Estimation

Python 100.00%
face face-recognition face-detection smartcar deep-learning mtcnn-face-detection facenet

smartcar's Introduction

Real-time FaceRecognition & HeadPose Estimation

SmartCar - face recognition (Driver / Passenger)

This is completly based on deep learning nueral network and implented using Tensorflow framework. Here you will get how to implement fastly and you can find code at github and uses is demonstrated at YouTube.

Installation Python Libraries:

  • Tensorflow (1.10.0)
  • Scipy (1.1.0)
  • Scikit-learn (0.19.1)
  • Opencv (3.4.4.19)

For ipmlementation and run this code follow this BLOG link. Implemention in video is shown YouTube.
Download FaceNet Pre-trained models: 20170512-110547.pb - [Google Drive] / [Baidu Drive]

Training using the VGGFace2 dataset - [Link]


Getting Started:

(make sure you have Pre-trained models .pb file)

  • Put your Pre-trained models 20170512-110547.pb file under './model/' folder.

  • data_preprocess.py put img under './train_img' folder and run data_preprocess.py output preprocessed img to './pre_img' folder.

  • train_classifier.py training your own data under './pre_img' folder and output classifier.pkl file to './classifier/' folder.

  • identify_face_image.py face recognition on your own images(change 'input_image' path)

  • identify_face_video.py face recognition on your own videos(change 'input_video' path)


SmartCar - head pose estimation (Driver)



Hopenet is an accurate and easy to use head pose estimation network. Models have been trained on the 300W-LP dataset and have been tested on real data with good qualitative performance.

For details about the method and quantitative results please check the paper.

new GoT trailer example video

new Conan-Cruise-Car example video

To use please install PyTorch and OpenCV (for video) - I believe that's all you need apart from usual libraries such as numpy. You need a GPU to run Hopenet (for now).


Getting Started:

To test on a video using dlib face detections (DLIB_MODEL: mmod_human_face_detector.dat):

python3 code/test_on_video_dlib.py --snapshot PATH_OF_PRE-TRAINED-MODELS --face_model PATH_OF_DLIB_MODEL --video PATH_OF_VIDEO --output_string STRING_TO_APPEND_TO_OUTPUT --n_frames N_OF_FRAMES_TO_PROCESS --fps FPS_OF_SOURCE_VIDEO

To test on a video using your own face detections (we recommend using dockerface, center of head will be smoother):

python3 code/test_on_video_dockerface.py --snapshot PATH_OF_SNAPSHOT --video PATH_OF_VIDEO --bboxes FACE_BOUNDING_BOX_ANNOTATIONS --output_string STRING_TO_APPEND_TO_OUTPUT --n_frames N_OF_FRAMES_TO_PROCESS --fps FPS_OF_SOURCE_VIDEO

Face bounding box annotations should be in Dockerface format (n_frame x_min y_min x_max y_max confidence).

Pre-trained models:

300W-LP, alpha 1

300W-LP, alpha 2

300W-LP, alpha 1, robust to image quality

For more information on what alpha stands for please read the paper. First two models are for validating paper results, if used on real data we suggest using the last model as it is more robust to image quality and blur and gives good results on video.

Please keep in mind that testing instructions to reproduce the paper results will be added very soon.

This work is still in progress - we are obtaining better results and will also be updating this README with instructions. Please open an issue if you have an problem.

Some things that will be added:

  • Test script for images
  • Docker image
  • Instructions for all scripts
  • Better and better models
  • Videos and example images!

If you find Hopenet useful in your research please consider citing:

References:

FaceNet - "FaceNet: A Unified Embedding for Face Recognition and Clustering"
Face alignment using MTCNN - "Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks"
@AI Sangam

For details about the method and quantitative results please check the paper. Nataniel Ruiz, Eunji Chong, James M. Rehg Georgia Institute of Technology

smartcar's People

Contributors

yehengchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

smartcar's Issues

Ask about IDE

Hi ye,
Which IDE are using?
Best Regards,
PeterPham

Issue

Hi yehengchen,
When i run data_preprocess.py. I face the issue: Traceback (most recent call last):
File "data_preprocess.py", line 7, in
nrof_images_total,nrof_successfully_aligned=obj.collect_data()
File "/home/thanhpham/PycharmProjects/FaceNet/FaceRecognition-FaceNet/preprocess.py", line 52, in collect_data
img = misc.imread(image_path)
AttributeError: module 'scipy.misc' has no attribute 'imread'
Please give me some advice?
Best regards,
Thanks

Issue

Hi yehengchen,
I am facing this issue:
Traceback (most recent call last):
File "identify_face_video.py", line 129, in
if HumanNames[best_class_indices[0]] == H_i:
IndexError: list index out of range

Please give me some advice?

Best regards,
PeterPham

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.