Git Product home page Git Product logo

human-falling-detect-tracks's Introduction

Human Falling Detection and Tracking

Using Tiny-YOLO oneclass to detect each person in the frame and use AlphaPose to get skeleton-pose and then use ST-GCN model to predict action from every 30 frames of each person tracks.

Which now support 7 actions: Standing, Walking, Sitting, Lying Down, Stand up, Sit down, Fall Down.

Prerequisites

  • Python > 3.6
  • Pytorch > 1.3.1

Original test run on: i7-8750H CPU @ 2.20GHz x12, GeForce RTX 2070 8GB, CUDA 10.2

Data

This project has trained a new Tiny-YOLO oneclass model to detect only person objects and to reducing model size. Train with rotation augmented COCO person keypoints dataset for more robust person detection in a variant of angle pose.

For actions recognition used data from Le2i Fall detection Dataset (Coffee room, Home) extract skeleton-pose by AlphaPose and labeled each action frames by hand for training ST-GCN model.

Pre-Trained Models

Basic Use

  1. Download all pre-trained models into ./Models folder.
  2. Run main.py
    python main.py ${video file or camera source}

Reference

human-falling-detect-tracks's People

Contributors

gajuuzz avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

human-falling-detect-tracks's Issues

Can't recognized or detect using webcamera

Hi thanks for this wonderful repo, I have a problem when using web camera. Upon running ' python main.py -C 0 ' there are no bounding boxes displayed or it doesn't detect. How can I fix it? Thanks in advance

Can you give me some datas to train st-gcn?

I want the data to train st-gcn,such as
'../Data/Coffee_room_new-set(labelXscrw).pkl',
'../Data/Home_new-set(labelXscrw).pkl'
Can you share your data with me.
I don't know how to mark it, or can I have a look at your file data template.
Thanks very much.
If ok ,please send me an email to [email protected].

AttributeError: 'NoneType' object has no attribute 'copy'

The full error is :
Traceback (most recent call last):
File "E:/Human-Falling-Detect-Tracks-master/main.py", line 106, in
frame = cam.getitem()
File "E:\Human-Falling-Detect-Tracks-master\CameraLoader.py", line 58, in getitem
frame = self.frame.copy()
AttributeError: 'NoneType' object has no attribute 'copy'
How do I fix this error? Any help would be gladly appreciated.

How can i generate annot_folder(bounding box annotation for each frame.)

dear friend. i want train this stgcn use my own dataset.but i can not use Data/create_dataset_2.py.Beacuse i can not create annot_folder = '../Data/falldata/Home/Annotation_files' # bounding box annotation for each frame.My question is how can i create this file. Is Yolo model generated (use Detection/Models)?or i show find other method? if you know.please give me some advices
please. this project is very importent for me.

Hi, I got problems in running train.py (about data_files)

First thank you for your sharing. I got questions in running train.py.
data_files = ['../Data/Coffee_room_new-set(labelXscrw).pkl',
'../Data/Home_new-set(labelXscrw).pkl']
I'm wondering what's the difference between the two pkl files. What the 'Coffee' means? Are the two pkl file create from one video or from different videos?
I can already run 1-3 create_dataset code.
I'm really appreciate if you can give me some advice on running train.py.

Questions about retraining

Hello, if you want to retrain models of different types of actions, can you provide training files? In addition, I request to introduce the label format requirements of the training data set.

python3 create_dataset_2.py have a error

xs@xs:~/Human-Falling-Detect-Tracks/Data$ python3 create_dataset_2.py
Loading pose model from ../Models/sppe/fast_res50_256x192.pth
Process on: video (1).avi
Traceback (most recent call last):
File "create_dataset_2.py", line 93, in
torch.tensor([[1.0]]))
File "../PoseEstimateLoader.py", line 38, in predict
result = pose_nms(bboxs, bboxs_scores, xy_img, scores)
File "../pPose_nms.py", line 102, in pose_nms
preds_pick[j], ori_pose_preds[merge_id], ori_pose_scores[merge_id], ref_dists[pick[j]])
File "../pPose_nms.py", line 226, in p_merge_fast
mask = (dist <= ref_dist)
RuntimeError: Expected object of scalar type Float but got scalar type Long for argument #2 'other'

i can't run the program

HI ,
sorry that i am first time to try on , I want to test your program using " python main.py $office_demo.avi " but it can't to run and showing below:
usage: main.py [-h] [-C CAMERA] [--detection_input_size DETECTION_INPUT_SIZE]
[--pose_input_size POSE_INPUT_SIZE]
[--pose_backbone POSE_BACKBONE] [--show_detected]
[--show_skeleton] [--save_out SAVE_OUT] [--device DEVICE]
main.py: error: unrecognized arguments: .avi

could you guide me how to ? Thanks!

Wilson

weight file

HI!
I want to ask that is the fast_res50_256x192.pth weight file is trained by alphapose? tsstg-model.pth trained by st-gcn or mmskeleton, best_ model.pth weight file trained by Yolov3? because I want to train my own weight file,thanks!

torch.nn.BCELoss()

Hi! Awesome work!However I found you use BCELoss as your loss in train.py? Can you explain why BCE but not CrossEntropyLoss? Thanks.

A Problem in the create_dataset_2.py

Hi , I have a problem confused me.
’‘’
Loading pose model from ./Models/sppe/fast_res50_256x192.pth
Process on: video (1).avi
Process on: video (10).avi
Traceback (most recent call last):
File "/home/wangliu/.local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2898, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'video'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "create_dataset_2.py", line 142, in
frames_label = annot[annot['video'] == vid].reset_index(drop=True)
File "/home/wangliu/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 2906, in getitem
indexer = self.columns.get_loc(key)
File "/home/wangliu/.local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2900, in get_loc
raise KeyError(key) from err
KeyError: 'video'
‘’‘
When I run the Python file, it occured some times that in the program, then I debug it. Then I found that the first video is normal, the second video do not work.
I'd appreciate any information someone could give me.

_pickle.UnpicklingError: invalid load key, 'v'.

when I load yoloV3 ,I meet this error:
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.
I have tried torch 1.4 1.5 and 1.6 , but have same error,
can you give me some help. thank you

Can you share the falling dataset

Hi,

I am very interested in your work and want to make this work run, but it seems that the dataset link is invalid. Can you provide a link to share the dataset?

RuntimeError: Error(s) in loading state_dict for Darknet: Unexpected key(s) in state_dict: "module_list.0.batch_norm_0.num_batches_tracked", "module_list.2.batch_norm_2.num_batches_tracked", "module_list.4.batch_norm_4.num_batches_tracked", "module_list.6.batch_norm_6.num_batches_tracked", "module_list.8.batch_norm_8.num_batches_tracked", "module_list.10.batch_norm_10.num_batches_tracked", "module_list.12.batch_norm_12.num_batches_tracked", "module_list.13.batch_norm_13.num_batches_tracked", "module_list.14.batch_norm_14.num_batches_tracked", "module_list.18.batch_norm_18.num_batches_tracked", "module_list.21.batch_norm_21.num_batches_tracked".

sequential action frames training in create_dataset_3.py

Hi GajuuzZ, Im really appreciated for your dataset code.
I have a question about seq_label_smoothing code.

Can I understand that sequentual action frames influence model training??
For example, if I want to train about the fight action, it will be trained action frames from before to after the fists are stretched?

Thank you for your replying in advance.

a different place between the code and the paper

the strategy: Spatial Configuration
Here the average coordinate of all joints in the skeleton at a frame is treated as its gravity center(this is the original sentence in the paper)
but the code about how to define gravity center is ‘self.center = 13’
When I run this project in my computer,I dont think the result is good . Will this setup affect the final accuracy ?

ImportError: cannot import name 'InferenNet_fastRes50'

Traceback (most recent call last):
File "D:/installedProjects/PyCharm_Projects/Human-Falling-Detect-Tracks/main.py", line 12, in
from PoseEstimateLoader import SPPE_FastPose
File "D:\installedProjects\PyCharm_Projects\Human-Falling-Detect-Tracks\PoseEstimateLoader.py", line 5, in
from SPPE.src.main_fast_inference import InferenNet_fast, InferenNet_fastRes50
ImportError: cannot import name 'InferenNet_fastRes50'

NaN may appear in the demo

great repo. I ran some tests and found that NaN may appear in the code, speciffically, in the bbox calculation and iou function.

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.