linzaer / face-track-detect-extract Goto Github PK
View Code? Open in Web Editor NEW💎 Detect , track and extract the optimal face in multi-target faces (exclude side face and select the optimal face).
License: MIT License
💎 Detect , track and extract the optimal face in multi-target faces (exclude side face and select the optimal face).
License: MIT License
Hi, thanks for amazing code.
After get cropped = frame[bb[1]:bb[3], bb[0]:bb[2], :].copy()
i saved it to backend.
How can i know images for per ID tracker for face recognition?
Thanks so much.
hello,I want test your algorithm.But numba versions I don‘t know,so have some bug.Please tell me what is numba versions?thanks
怎么改写能够通过摄像头输入呢
is any body interested in c++ version of this repo?
i started to convert this code to c++ and add face recog to end of it,
i want to share it with anyone who wants to be a partner in developing it.
please contact me. Thank you
i think your code is amazing
i want to make it better,
when we extract face sometime it is side face and i dont want side face at all
i notticed you have judge-side-face and sort base on face scores in your code
can you suggest any solution?
您好,我测试您的项目是,获得的人脸图像并不都是清晰和质量高的,请问在您在项目中有人脸质量分析的内容?有的话需要调整什么参数呢?
你好,我用GPU和CPU测试你的mtcnn,怎么检测速度差不多?
你好,请问可以简单介绍下如何判断正脸的思路(judge_side_face)吗?谢谢!
I tried to run sart.py but it gives the mentioned error. I tracked the source of the error down to from filterpy.kalman import KalmanFilter
in src>sort.py
I have all the dependencies required for the project with anaconda
Hi! I'm trying to apply your project under the CCTV scenario and your sample video in the results section of README is a good test video. Could you please provide the video? Thank you very much!
在进行多人脸检测跟踪时,发现可以检测跟踪到的人脸(有矩形框显示框住了),但是并未在facepic中成功保存下来(包括一些质量很好的正脸也没有保存),只保存了部分人脸
File "d:\ZERO2\�Ѻ�˹��\Face-Track-Detect-Extract-master\start.py", line 176, in
main()
File "d:\ZERO2\�Ѻ�˹��\Face-Track-Detect-Extract-master\start.py", line 39, in main
with tf.Session(config= tf.ConfigProto(gpu_options=tf.GPUOptions(allow_growth=True),
AttributeError: module 'tensorflow' has no attribute 'Session'
Thanks for this great repo, really cool.
I wanted to share and compile some of the changes I had to do to make it work with my current (recent) setup.
The issues for me were related to numpy version (I have version 1.19.4) and sklearn (I have version 0.23.1).
Note that I have tensorflow v1.15.2, so I did not encounter any tf related pains, but if you have tf >=2.0 you certainly will (look at the issues opened on this).
Error 1: "No module named 'sklearn.utils.linear_assignment_'" from the file data file src/data_association.py
This was linked to my sklearn version, "linear_assignment_" has been deprecated and removed from sklearn 0.23. So I found a few solutions here.
I initially tried the first answer (using from scipy.optimize import linear_sum_assignment as linear_assignment
), which kind of worked but its output format is not the same as the original sklear function.
So I ended up using the third answer where a specific wrapping function is created (you need to have lap and scipy installed as replacements for sklearn):
from sklearn.utils.linear_assignment_ import linear_assignment
def linear_assignment(cost_matrix):
try:
import lap
_, x, y = lap.lapjv(cost_matrix, extend_cost=True)
return np.array([[y[i], i] for i in x if i >= 0])
except ImportError:
from scipy.optimize import linear_sum_assignment
x, y = linear_sum_assignment(cost_matrix)
return np.array(list(zip(x, y)))
It worked like a charm.
Error 2: "ValueError: Object arrays cannot be loaded when allow_pickle=False" triggered from file align\detect_face.py while loading the model weights.
This has been soled already in this issue.
Use the last trick of the issue, i.e. in align/detect_faces.py replace data_dict = np.load(data_path, encoding='latin1').item()
with data_dict = np.load(data_path, encoding='latin1', allow_pickle=True).item()
Hope this helps some to get the repo running in >=2021.
D:\Practice\scs\lab\facextract>python start.py videos
2019-05-07 21:15:01,587 - MOT - INFO - Start track and extract...... - MainThread - 6832
2019-05-07 21:15:01.602733: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From C:\Python36\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From D:\Practice\scs\lab\facextract\align\detect_face.py:212: calling reduce_max_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From D:\Practice\scs\lab\facextract\align\detect_face.py:214: calling reduce_sum_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From D:\Practice\scs\lab\facextract\align\detect_face.py:215: div (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Deprecated in favor of operator or tf.math.divide.
Traceback (most recent call last):
File "start.py", line 147, in
main()
File "start.py", line 33, in main
pnet, rnet, onet = detect_face.create_mtcnn(sess, os.path.join(project_dir, "align"))
File "D:\Practice\scs\lab\facextract\align\detect_face.py", line 289, in create_mtcnn
pnet.load(os.path.join(model_path, 'det1.npy'), sess)
File "D:\Practice\scs\lab\facextract\align\detect_face.py", line 87, in load
data_dict = np.load(data_path, encoding='latin1').item() # pylint: disable=no-member
File "C:\Python36\lib\site-packages\numpy\lib\npyio.py", line 447, in load
pickle_kwargs=pickle_kwargs)
File "C:\Python36\lib\site-packages\numpy\lib\format.py", line 692, in read_array
raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False
D:\Practice\scs\lab\facextract>
如题,没找到合适的demo视频,能否上传一下?非常感谢
how to get det1.npy ,det2.npy?
how to train my own darasets?
thanks
Hi can you provide us any information about FPS ?
Thank you
简单看了一下代码,咱这个识别用的是mtcnn吧?如果是cpu模式的话也能达到效果图那样么?谢谢
你好,请问下检测后的视频(带有检测框的)保存的路径是哪里呢?
I am having the following problem. Is there problem with the code?
python3 start.py
/root/Buddha/anaconda3/envs/pyannote/lib/python3.7/site-packages/sklearn/utils/linear_assignment_.py:21: DeprecationWarning: The linear_assignment_ module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead.
DeprecationWarning)
2019-09-09 01:46:17,300 - MOT - INFO - Start track and extract...... - MainThread - 28614
WARNING:tensorflow:From start.py:40: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.
WARNING:tensorflow:From start.py:40: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.
WARNING:tensorflow:From start.py:40: The name tf.GPUOptions is deprecated. Please use tf.compat.v1.GPUOptions instead.
2019-09-09 01:46:17.383737: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-09-09 01:46:17.417351: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2099995000 Hz
2019-09-09 01:46:17.421622: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x56455b944000 executing computations on platform Host. Devices:
2019-09-09 01:46:17.421739: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): ,
WARNING:tensorflow:From /root/Buddha/anaconda3/envs/pyannote/lib/python3.7/site-packages/tensorflow/python/ops/init_ops.py:1251: calling VarianceScaling.init (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
WARNING:tensorflow:From /root/Buddha/github_tools/Face-Track-Detect-Extract/align/detect_face.py:215: div (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Deprecated in favor of operator or tf.math.divide.
2019-09-09 01:46:17.787762: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set. If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU. To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
2019-09-09 01:46:20,198 - MOT - INFO - All files:1 - MainThread - 28614
2019-09-09 01:46:20,198 - MOT - INFO - All files:2_Obama.mp4 - MainThread - 28614
Traceback (most recent call last):
File "start.py", line 177, in
main()
File "start.py", line 51, in main
suffix = filename.split('.')[1]
IndexError: list index out of range
大佬用的多目标跟踪能简单说一下么?我看见一个卡尔曼滤波跟踪,是不是特定情况可能会发生跟踪错乱的情况呢?
hi friend, how do i implement your code in my virtual environment?
File "start.py", line 176, in
main()
File "start.py", line 41, in main
pnet, rnet, onet = detect_face.create_mtcnn(sess, os.path.join(project_dir, "align"))
File ".\align\detect_face.py", line 290, in create_mtcnn
pnet.load(os.path.join(model_path, 'det1.npy'), sess)
File ".\align\detect_face.py", line 88, in load
data_dict = np.load(data_path, encoding='latin1').item()
File "conda\envs\skellam\lib\site-packages\numpy\lib\npyio.py", line 453, in load
pickle_kwargs=pickle_kwargs)
File ".conda\envs\skellam\lib\site-packages\numpy\lib\format.py", line 722, in read_array
raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False
你好 在src文件夹中的correlation_tracker.py 脚本,导入了dlib,请问dlib是开源的库还是别的什么, 并没有找到呢
Hello
Nice to meet you.
I should perform multi-person face tracking project, and I think it is really good demo for my project.
So I want to study something from this repository, but I can't run this on Tensorflow 2.0.
Of courrse I know that this is for Tensorflow 1.0 but not for Tensorflow 2.0.
However I am using Tensorflow 2.0 and it is necessary to run on 2.0.
So would you help me to run this project on Tensorflow 2.0?
Thank you
Confidence9898
Hey!
Thanks for your work on the repo.
My issue is as follows : Currently, on the original sort repo, the author mentions to run the detection model in every frame. Hungarian algorithm is then run to find matching between detection output of current frame and predicted tracking output of previous frame (the second part uses Kalman Filter).
If however, detection is run every k frames, and during detection at current frame a new object is detected (for which we create a new tracker), then currently there is a high uncertainty over how that bounding box will move(since we just created a new tracker for it), and the outputs should be noisy for the subsequent k - 1 frames.
Can you please share your insight on this?
Also, I have another question. Do you think that using Kalman Filter is really necessary? What if we run the detection model every frame, and run hungarian algorithm between detection output at frame i+1 and frame i to find the associations? Since we are not skipping frames and objects will not show any sudden movement between frame i and frame i+1, this approach should work.
Thanks once again for your effort on this.
Hi I actually cloned this issue but I met the problemm
def __init__(self, module_name="MOT") -> None:
^
SyntaxError: invalid syntax
any idea to fix this
Are you planning to make it compatible with Tensorflow 2? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.