Compare commits

...

29 Commits

Author SHA1 Message Date
王洋 4c6839c77c modify the document 2021-11-20 23:10:21 +08:00
王洋 7588e4157a modify the document 2021-11-20 23:05:15 +08:00
王洋 21f282f3d5 modify the document 2021-11-20 22:49:38 +08:00
王洋 b238c81513 modify the document 2021-11-20 22:47:20 +08:00
王洋 e4ad2a71f1 modify the document 2021-11-20 22:43:27 +08:00
王洋 9910d1b831 modify the document 2021-11-20 22:41:09 +08:00
pkwhiuqat b59db8c572 Update algorithms.py 2021-11-20 21:42:40 +08:00
pkwhiuqat b5de475d96 Update helpers.py 2021-11-20 21:40:45 +08:00
王洋 4f61205050 add documents 2021-11-20 20:23:39 +08:00
王洋 42a1c03bed add documents 2021-11-20 20:22:24 +08:00
王洋 b7177f5f98 add documents 2021-11-20 19:56:40 +08:00
pkwhiuqat 5319073738 Update README 2021-11-20 19:33:36 +08:00
pkwhiuqat eefa4ca518 Update README 2021-11-20 19:27:54 +08:00
pkwhiuqat 1ae371ffc9 Update README 2021-11-20 17:52:17 +08:00
pa67p85k2 56fecc007e Delete 'documents/行为识别开源技术报告(改6).docx' 2021-11-20 17:25:41 +08:00
pa67p85k2 6e9c467a0d ADD file via upload 2021-11-20 17:24:27 +08:00
pa67p85k2 6874994993 Delete 'documents/行为识别开源技术报告(改2).docx' 2021-11-20 17:15:39 +08:00
pkwhiuqat cbc6925370 add documents 2021-11-20 13:06:29 +08:00
pkwhiuqat 68784be3ac Update README 2021-11-20 11:23:36 +08:00
pkwhiuqat 845199c063 Update README.md 2021-11-20 11:22:53 +08:00
pkwhiuqat 696b6ba83e Update README.md 2021-11-20 11:21:38 +08:00
pkwhiuqat 8c01ed3a75 Update README 2021-11-20 11:20:18 +08:00
pkwhiuqat 5a8540471e Update README 2021-11-20 11:10:06 +08:00
pkwhiuqat a9402a0609 Update README 2021-11-20 11:08:27 +08:00
pa67p85k2 c473ef4b6c ADD file via upload 2021-11-20 01:59:35 +08:00
pa67p85k2 7b2531eb8d Delete 'documents/行为识别开源技术报告(改).docx' 2021-11-20 01:59:04 +08:00
pa67p85k2 9f46b783ed ADD file via upload 2021-11-19 00:14:13 +08:00
王洋 d209d631cf Update README 2021-11-05 15:23:35 +08:00
王洋 82e73d8fd2 add documents 2021-11-05 15:20:32 +08:00
10 changed files with 122 additions and 8 deletions

125
README.md
View File

@ -1,6 +1,9 @@
# 基于 OpenPifPaf 的多摄像头、多人实时跌倒检测模型
# 基于 OpenPifPaf 的多摄像头多人实时跌倒等异常行为识别预警应用研究
<p align="center">
<img src="https://git.trustie.net/pkwhiuqat/HumanFallDetectionLSTM/raw/branch/master/examples/outfallingdown.gif?raw=true" alt="outfallingdown"/>
<img src="https://git.trustie.net/pkwhiuqat/HumanFallDetectionLSTM/raw/branch/master/documents/outfallingdown1.gif?raw=true" alt="outfallingdown"/>
<p align="center">
<img src="https://git.trustie.net/pkwhiuqat/HumanFallDetectionLSTM/raw/branch/master/documents/outfallingdown2.gif?raw=true" alt="outfallingdown" style="zoom:90%;"/>
利用 OpenPifPaf 对输入视频进行人体姿势估计,然后通过长短时记忆神经网络LSTM从前面得到的姿势信息中提取五个时间和空间特征作为当前的 *X*<sub>n</sub> 输入)以预测"跌倒"动作,支持多摄像头和多人实时检测。模型在 UP-Fall Detection 数据集上训练,基于 PyTorch 实现。
@ -19,7 +22,123 @@ pip install -r requirements.txt
python fall_detector.py --num_cams=1
```
## 完整运行代码
usage: fall_detector.py [-h] [--seed-threshold SEED_THRESHOLD]
[--instance-threshold INSTANCE_THRESHOLD]
[--keypoint-threshold KEYPOINT_THRESHOLD]
[--decoder-workers DECODER_WORKERS]
[--dense-connections]
[--dense-coupling DENSE_COUPLING] [--caf-seeds]
[--no-force-complete-pose]
[--profile-decoder [PROFILE_DECODER]]
[--cif-th CIF_TH] [--caf-th CAF_TH]
[--connection-method {max,blend}] [--greedy]
[--checkpoint CHECKPOINT] [--basenet BASENET]
[--headnets HEADNETS [HEADNETS ...]] [--no-pretrain]
[--two-scale] [--multi-scale] [--no-multi-scale-hflip]
[--cross-talk CROSS_TALK] [--no-download-progress]
[--head-dropout HEAD_DROPOUT] [--head-quad HEAD_QUAD]
[--resolution RESOLUTION] [--resize RESIZE]
[--num_cams NUM_CAMS] [--video VIDEO] [--debug]
[--disable_cuda] [--plot_graph] [--joints]
[--skeleton] [--coco_points] [--save_output]
[--fps FPS] [--out-path OUT_PATH]
[--input_direct INPUT_DIRECT]
optional arguments:
-h, --help show this help message and exit
--resolution RESOLUTION
Resolution prescale factor from 640x480. Will be
rounded to multiples of 16. (default: 0.4)
--resize RESIZE Force input image resize. Example WIDTHxHEIGHT.
(default: None)
--num_cams NUM_CAMS Number of Cameras. (default: 1)
--video VIDEO Path to the video file. For single video fall
detection(--num_cams=1), save your videos as abc.xyz
and set --video=abc.xyz For 2 video fall
detection(--num_cams=2), save your videos as abc1.xyz
& abc2.xyz and set --video=abc.xyz (default: None)
--debug debug messages and autoreload (default: False)
--disable_cuda disables cuda support and runs from gpu (default:
False)
decoder configuration:
--seed-threshold SEED_THRESHOLD
minimum threshold for seeds (default: 0.5)
--instance-threshold INSTANCE_THRESHOLD
filter instances by score (default: 0.2)
--keypoint-threshold KEYPOINT_THRESHOLD
filter keypoints by score (default: None)
--decoder-workers DECODER_WORKERS
number of workers for pose decoding (default: None)
--dense-connections use dense connections (default: False)
--dense-coupling DENSE_COUPLING
dense coupling (default: 0.01)
--caf-seeds [experimental] (default: False)
--no-force-complete-pose
--profile-decoder [PROFILE_DECODER]
specify out .prof file or nothing for default file
name (default: None)
CifCaf decoders:
--cif-th CIF_TH cif threshold (default: 0.1)
--caf-th CAF_TH caf threshold (default: 0.1)
--connection-method {max,blend}
connection method to use, max is faster (default:
blend)
--greedy greedy decoding (default: False)
network configuration:
--checkpoint CHECKPOINT
Load a model from a checkpoint. Use "resnet50",
"shufflenetv2k16w" or "shufflenetv2k30w" for
pretrained OpenPifPaf models. (default: None)
--basenet BASENET base network, e.g. resnet50 (default: None)
--headnets HEADNETS [HEADNETS ...]
head networks (default: None)
--no-pretrain create model without ImageNet pretraining (default: True)
--two-scale [experimental] (default: False)
--multi-scale [experimental] (default: False)
--no-multi-scale-hflip
[experimental] (default: True)
--cross-talk CROSS_TALK
[experimental] (default: 0.0)
--no-download-progress
suppress model download progress bar (default: True)
head:
--head-dropout HEAD_DROPOUT
[experimental] zeroing probability of feature in head
input (default: 0.0)
--head-quad HEAD_QUAD
number of times to apply quad (subpixel conv) to heads
(default: 1)
Visualisation:
--plot_graph Plot the graph of features extracted from keypoints of
pose. (default: False)
--joints Draw joints keypoints on the output video. (default: True)
--skeleton Draw skeleton on the output video. (default: True)
--coco_points Visualises the COCO points of the human pose. (default: False)
--save_output Save the result in a video file. Output videos are
saved in the same directory as input videos with "out"
appended at the start of the title (default: False)
--fps FPS FPS for the output video. (default: 18)
--out-path OUT_PATH Save the output video at the path specified. .avi file
format. (default: result.avi)
--input_direct INPUT_DIRECT
Save the input link to images directory. (default: None)
- 模型输入可以直接为摄像头作为视频源或者用下载好的视频作为视频源。
- 如果在非服务器端可以通过设置在窗口进行实时画面的显示。
## 参考
- [OpenPifPaf](https://github.com/openpifpaf/openpifpaf)
- [UP-fall detection Dataset](https://dx.doi.org/10.3390/s19091988)
- [Multi-camera, multi-person, and real-time fall detection using long short term memory](https://doi.org/10.1117/12.2580700)
- [Multi-camera, multi-person, and real-time fall detection using long short term memory](https://doi.org/10.1117/12.2580700)
- Lei Wang, Du Q. Huynh, Piotr Koniusz. A Comparative Review of Recent Kinect-based Action Recognition Algorithms[J]. IEEE TRANSACTIONS ON IMAGE PROCESSING,2019.
- Nusrat Tasnim , Mohammad Khairul Islam and Joong-Hwan Baek. Deep Learning Based Human Activity Recognition Using Spatio-Temporal Image Formation of Skeleton Joints[J].applied sciences.
- Mickael Delamare, Cyril Laville, Adnane Cabani and Houcine Chafouk. Graph Convolutional Networks Skeleton-based Action Recognition for Continuous Data Stream: A Sliding Window Approach[J]. 16th International Conference on Computer Vision Theory and Applications.
- Tasweer Ahmad, Lianwen Jin, Xin Zhang, Songxuan Lai, Guozhi Tang, and Luojun Lin. Graph Convolutional Neural Network for Human Action Recognition: A Comprehensive Survey[J].
- Zehua Sun, Jun Liu, Qiuhong Ke, Hossein Rahmani, Mohammed Bennamoun, and Gang Wang. Human Action Recognition from Various Data Modalities: A Review[J].

View File

@ -35,7 +35,6 @@ def get_source(args):
logging.debug('Image shape:', img.shape)
return cam, tagged_df
def resize(img, resize, resolution):
# Resize the video
if resize is None:
@ -124,10 +123,8 @@ def extract_keypoints_parallel(queue, args, self_counter, other_counter, consecu
queue.put(None)
return
###################################################### Post human estimation ###########################################################
def show_tracked_img(img_dict, ip_set, num_matched, output_video, args):
img = img_dict["img"]
tagged_df = img_dict["tagged_df"]

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

BIN
documents/演示视频3.avi Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -10,7 +10,6 @@ def pop_and_add(l, val, max_length):
l.pop(0)
l.append(val)
def last_ip(ips):
for i, ip in enumerate(reversed(ips)):
if ip is not None:
@ -71,5 +70,4 @@ def get_hist(img, bbox, nbins=3):
hist = cv2.calcHist([img], [0, 1], mask, [nbins, 2*nbins], [0, 180, 0, 256])
cv2.normalize(hist, hist, alpha=1, norm_type=cv2.NORM_L1)
return hist