Giter Site home page Giter Site logo

jithlord / activity_detection Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 4.0 2.31 MB

Live Human Activity recognition using Tensorflow transfer learning model, OpenCV and numpy with a custom Dataset by scraping the web.

Jupyter Notebook 40.29% Python 59.71%
activity-recognition human-activity-recognition human-pose-estimation human recognition recognition-algorithms

activity_detection's Introduction

Activity_Detection

This repository uses tensorflow to train on 4268 Non copyrighted images obtained after scraping duckduckgo searches to classify live using the camera into 6 different categories Sitting, Standing, Walking, Walking on Stairs and Control.

Issues? Email Me: [email protected]

IMPORTANT

Feel free to use the code, make sure you give us credits everytime you use the code.

Dataset

Dataset divided into 6 categories of 150x150x3 ie the image of size 150x150 and a 3 channel(RGB). Category Control used to prevent Random images to be classified into any of the remaining 5 categories. Use of Augmentation to have more number of images to train the model. The dataset involved humans of various backgrounds, ages, skin tone, time of day.

*My dataset is now available to download for free on kaggle https://www.kaggle.com/jithinnambiarj/human-activity-detection-dataset?rvi=1 .*
**Please do give me credits everytime you use it.**

Code

Using InceptionV3 transfer learning model, along with mixed7 layer, 1024 neuron Selu with activation, 0.1 Dropout, 512 neuron with Selu activation, 0.1 dropout and 6 Neuron with softmax Activation. Use of RMSprop optimizer with learning rate 0.0001 and loss function as categorical crossentropy.

Block Diagram of the Project




                                              Training Accuracy                                                                             Training Loss

Important

You can run this program on colab.research.google.com with a TPU or GPU for faster processing. THe code is attached here in .ipynb format, just copy the code to the colab website. Click runtime and change runtime type to GPU or TPU for faster processing

Download the .h5 model

https://we.tl/t-HBscIiHwov

For loading images from your drive:

  from google.colab import drive
  drive.mount('/content/drive')

or you could do this and also specify the exact folder where you want it to take from:

  1. Runtime -> Change runtime type -> GPU or TPU
  2. Click on Files from the left toolbar
  3. Click Mount drive
  4. Copy the path of the dataset folder (and assign them to the train_dir and val_dir)

Please feel free to open any issues

Some resources you can use to improve your model:

  1.  https://www.tensorflow.org/tutorials/keras/overfit_and_underfit
    
  2.  https://www.tensorflow.org/tutorials/keras/save_and_load
    
  3.  https://www.tensorflow.org/tutorials/images/classification (Super useful)
    
  4.  https://www.tensorflow.org/tutorials/images/transfer_learning
    
  5.  https://www.tensorflow.org/api_docs/python/tf/keras/losses
    
  6.  https://www.tensorflow.org/api_docs/python/tf/keras/layers
    

The LiveClassifier.py file can be used to classify images from a webcam or any camera.

activity_detection's People

Contributors

jithlord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

activity_detection's Issues

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.