赞
踩
a very simple Fall-detection(摔倒/跌倒检测)using yolo2
项目地址:https://github.com/qiaoguan/Fall-detection
Fall-detection(摔倒/跌倒检测)in the room
this fall-detection is based on darknet.
we first detect humans in the room, then we use some simple ways to judge whether he or she is falling down.
Install on Linux
First, make sure you have install python and opencv environment(p.s. if you do not have GPU support, change the first line and second line of Makefile value from 1 to 0)
Then, install this module :
- git clone https://github.com/qiaoguan/Fall-detection
- cd Fall-detection
- sudo make
If you are having trouble with installation, you can Issue me!
First, download yolo.weights, the password is: bp6c. Then, install this module :
python gq.py
for opencv3 users, you can refer to this code
执行make命令的时候遇到以下错误:
- /usr/local/include/opencv2/core/cvdef.h:485:1: error: unknown type name ‘namespace’
- namespace cv {
- ^
- compilation terminated due to -Wfatal-errors.
- Makefile:85: recipe for target 'obj/gemm.o' failed
- make: *** [obj/gemm.o] Error 1
解决办法见这里
按上述解决后,又出现新的错误,如下:
- nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o
- /bin/sh: 1: nvcc: not found
- Makefile:88: recipe for target 'obj/convolutional_kernels.o' failed
- make: *** [obj/convolutional_kernels.o] Error 127
这个时候只要执行下make clean就好了
执行python文件的时候,出现以下:
- Traceback (most recent call last):
- File "fall_detection.py", line 59, in <module>
- net = dn.load_net("cfg/yolo.cfg", "yolo.weights", 0)
- ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
只需要修改下:
- # load network and weights
- net = dn.load_net("cfg/yolo.cfg".encode('utf-8'), "yolo.weights".encode('utf-8'), 0)
- meta = dn.load_meta("cfg/coco.data".encode('utf-8'))
即可成功执行。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。