Activity_Detection:使用Tensorflow转移学习模型,OpenCV和numpy进行实时人类活动识别

  • t3_754443
    了解作者
  • 18.3KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-14 03:32
    上传日期
活动检测 该存储库使用tensorflow训练了4268个未受版权保护的图像,这些图像是在抓取duckduckgo搜索后使用相机将直播分类为6种不同的类别的结果,这些类别包括坐,站,走,走楼梯和控制。 重要的 随时使用该代码,请确保您每次使用该代码时都给我们积分。 数据集 数据集分为6类150x150x3,即大小为150x150的图像和3通道(RGB)。 类别控制,用于防止将随机图像分类为其余5个类别中的任何一个。 使用增强来获得更多数量的图像来训练模型。 数据集涉及各种背景,年龄,肤色,一天中的不同时间的人类。 *我的数据集现在可以在kaggle 免费下载。* **请在每次使用时都给我积分。** 代码 使用InceptionV3转移学习模型,以及mixed7层,具有激活的1024个神经元Selu,0.1个辍学,具有Selu激活的512个神经元,0.1个辍学和具有softmax激活的
Activity_Detection-main.zip
  • Activity_Detection-main
  • activity.ipynb
    3.6KB
  • main.py
    4.4KB
  • Accuracy.png
    13.2KB
  • LiveClassifier.py
    1.1KB
  • README.md
    3.6KB
内容介绍
# 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. ## 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. </br ></br > <p align="center"> <img src="https://user-images.githubusercontent.com/45201620/113389040-fa6c6d80-93ac-11eb-974e-ad3112eba8c3.png" width="60%"></img> </p> *My dataset is now available to download for free on kaggle https://www.kaggle.com/jithinnambiarj/human-activity-detection-dataset?rvi=1.* </br> **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. </br > </br > <p align="center"> <img src="https://user-images.githubusercontent.com/45201620/113389135-1f60e080-93ad-11eb-916b-c88b206104ee.png" width="60%"></img> </p> </br > <p align="center"> Block Diagram of the Project </br ></p> <p align="center"> <img src="https://user-images.githubusercontent.com/45201620/113389310-736bc500-93ad-11eb-80a7-88f476845f52.png" width="45%"></img> <img src="https://user-images.githubusercontent.com/45201620/113389339-7f578700-93ad-11eb-9f15-39aedcc44f16.png" width="45%"></img> </br ></p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Training Accuracy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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 1. https://www.tensorflow.org/tutorials/keras/save_and_load 1. https://www.tensorflow.org/tutorials/images/classification (Super useful) 1. https://www.tensorflow.org/tutorials/images/transfer_learning 1. https://www.tensorflow.org/api_docs/python/tf/keras/losses 1. 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.
评论
    相关推荐