viewfacecore / viewfacecore Goto Github PK
View Code? Open in Web Editor NEWC# 超简单的离线人脸识别库。( 基于 SeetaFace6 )
License: MIT License
C# 超简单的离线人脸识别库。( 基于 SeetaFace6 )
License: MIT License
ViewFace.DLL在其他电脑无法正常工作,部分电脑又可以,VC++从2010-2019全部装了也没用,源码也MT方式编译了,麻烦告知下需要什么库
用了台比较老的电脑去打开示例程序,打开不了,双击没反应。去查看了计算机管理的事件查看器提示有错误,就是这个 => 错误模块名称: KERNELBASE.dll。。请问这个应该怎么解决?还有啊用手头上比较新的电脑打开示例程序倒是没问题。。具体报错如下。
错误应用程序名称: FaceDetectionDemo.exe,版本: 1.0.0.0,时间戳: 0xf543f690
错误模块名称: KERNELBASE.dll,版本: 10.0.17763.292,时间戳: 0x02385dc9
异常代码: 0xe0434352
错误偏移量: 0x0011b022
错误进程 ID: 0x7f8
错误应用程序启动时间: 0x01d695ba7c7c5fd7
错误应用程序路径: C:\Users\Administrator\Desktop\Debug\FaceDetectionDemo.exe
错误模块路径: C:\Windows\System32\KERNELBASE.dll
报告 ID: 15eab584-857d-492b-bff9-fc90a0c95005
错误程序包全名:
错误程序包相对应用程序 ID:
故障存储段 ,类型 0
事件名称: CLR20r3
响应: 不可用
Cab ID: 0
问题签名:
P1: FaceDetectionDemo.exe
P2: 1.0.0.0
P3: f543f690
P4: ViewFaceCore
P5: 0.3.4.0
P6: 8756fe63
P7: cc
P8: 0
P9: System.DllNotFoundException
P10:
附加文件:
可在此处获取这些文件:
\?\C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_FaceDetectionDem_794690b9ff5ef43941c7fc4f9056b34ad43d3df_201518c4_0eb06610
分析符号:
重新检查解决方案: 0
报告 ID: 15eab584-857d-492b-bff9-fc90a0c95005
报告状态: 4102
哈希存储段: nCab GUID: 0
今天收到邮件说增加了口罩监测,但是在NuGet上的版本仍然为0.3.5,自己下了源码,但是ViewFaceBridge那里编不过,一堆奇怪的问题,我上个版本编译的时候没遇到过。能否将新版的ViewFaceBridge.dll以及ViewFaceCore.dll通过邮件发我一份。万分感谢
安装了:ViewFaceCore 0.3.5版本、 ViewFaceCore.runtime.win.vc、ViewFaceCore.runtime.win.x64、ViewFaceCore.all_models。
图片少的时候没问题,图片多的话就报错,不知道怎么回事,大佬最近有空看下吗
System.DllNotFoundException:“无法加载 DLL“ViewFaceBridge”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。”
.NET Core项目下, 多次进行检测图片中的人脸之后就提示越界然后程序终止.
调用方法 ViewFace.FaceMark()的时候,,返回的永远都是空数组,精度已经设置的很低了,换了很多张图片问题依旧
请问为什么开摄像头对准图片能把图片的人脸识别出来,直接传入图片人脸却识别不出来了呢?只是个别图片识别不出来,识别不出来人脸的图片像素也不大。。
貌似程序运行起来后只会读取tennis.dll文件,其它例如tennis_haswell.dll,tennis_pentium.dll,tennis_sandy_bridge.dll不会根据不同cpu的指令集去动态读取,只能修改文件名将之改tennis.dll才能去适应不同硬件环境,比如奔腾的机器就要将tennis_pentium.dll改名为tennis.dll程序才能跑起来,请问有什么好的方法去解决这个问题呢?
这个错误无解啊,识别个几张就会出现
同样的代码,同样的图片,控制台程序可以检测出来人脸。但是web项目一直检测不出来。是什么原因呢
你好 按照示例测试,完成一次人脸比对的完整过程大概需要3秒钟时间,加上其它逻辑处理后会更长。
请问如何再优化调用,能够进入到1秒内或者较短时间完成整个过程,2个测试图片均不超过300K。
下面是测试代码
`
private void button1_Click(object sender, EventArgs e)
{
ViewFace.FaceType = FaceType.Normal;
//目标图片
Bitmap targetImg = (Bitmap)Image.FromFile(@"D:\\测试文件\\裁.jpg");
FaceInfo[] targetFaces = ViewFace.FaceDetector(targetImg);
FaceMarkPoint[] targetMark = ViewFace.FaceMark(targetImg, targetFaces[0]);
AntiSpoofingStatus targetass = ViewFace.AntiSpoofing(targetImg, targetFaces[0], targetMark, true);
float[] targetExtract = ViewFace.Extract(targetImg, targetMark);
//基准图片
Bitmap baseImg = (Bitmap)Image.FromFile("D:\\测试文件\\2\\大文件4压缩后.png");
FaceInfo[] baseFaces = ViewFace.FaceDetector(baseImg);
FaceMarkPoint[] baseMark = ViewFace.FaceMark(baseImg, baseFaces[0]);
//AntiSpoofingStatus baseass = ViewFace.AntiSpoofing(baseImg, baseFaces[0], baseMark, true);
float[] baseExtract = ViewFace.Extract(baseImg, baseMark);
//结果
float similarity = ViewFace.Similarity(baseExtract, targetExtract);
bool isSelf = ViewFace.IsSelf(similarity);
}
`
SeetaFace6支持Linux,但是我自己不会C++,也不知道项目中ViewFace能否编译为Linux的动态链接库。可以的话,项目也可以在Linux中使用。
windows 10上一切正常,但是win7上会报DllNotFoundException异常。
应用程序: FaceDemo.exe
Framework 版本: v4.0.30319
说明: 由于未经处理的异常,进程终止。
异常信息: System.DllNotFoundException
在 ViewFaceCore.Plus.ViewFacePlus32.SetModelPath(Byte[])
在 ViewFaceCore.Plus.ViewFacePlus32.SetModelPath(System.String)
在 ViewFaceCore.Sharp.ViewFace..ctor(System.String)
在 ViewFaceCore.Sharp.ViewFace..ctor()
在 FaceDemo.FormMain..ctor(System.String[])
在 FaceDemo.Program.Main(System.String[])
var infos = ViewFace.FaceTrack(bitmap1); // 识别画面中的人脸
foreach (var info in infos)
{
ViewFaceCore.Sharp.Model.FaceMarkPoint[] pp = ViewFace.FaceMark(bitmap1, new ViewFaceCore.Sharp.Model.FaceInfo() { Location = info.Location, Score = info.Score });
float[] f= ViewFace.Extract(bitmap1, pp);
}
跑十几次就会报错,如下问题 期待作者更新
托管调试助手 "FatalExecutionEngineError"
运行时遇到了错误。此错误的地址为 0x1f6a7a22,在线程 0x55a0 上。错误代码为 0xc0000005。此错误可能是 CLR 中的 bug,或者是用户代码的不安全部分或不可验证部分中的 bug。此 bug 的常见来源包括用户对 COM-interop 或 PInvoke 的封送处理错误,这些错误可能会损坏堆栈。
我看到SeetaFace6 是有MaskDetector的,但是这个库没有口罩检测的api,目前刚好项目上要用到口罩检测。请问作者能够抽时间把口罩检测加上,不胜感激
托管调试助手 "FatalExecutionEngineError":“运行时遇到了错误。此错误的地址为 0x2f767932,在线程 0x1ba0 上。错误代码为 0xc0000005。此错误可能是 CLR 中的 bug,或者是用户代码的不安全部分或不可验证部分中的 bug。此 bug 的常见来源包括用户对 COM-interop 或 PInvoke 的封送处理错误,这些错误可能会损坏堆栈。”
测试代码:https://gitee.com/Protear/face-detection-console
托管调试助手 "FatalExecutionEngineError":“运行时遇到了错误。此错误的地址为 0x2f767932,在线程 0x1ba0 上。错误代码为 0xc0000005。此错误可能是 CLR 中的 bug,或者是用户代码的不安全部分或不可验证部分中的 bug。此 bug 的常见来源包括用户对 COM-interop 或 PInvoke 的封送处理错误,这些错误可能会损坏堆栈。”
ViewFaceCore\Plus\RuntimeInformation.Extension.cs
这段代码
public static bool IsOSPlatform(OSPlatform platform) => platform == OSPlatform.Windows;
不好意思,对这块技术不熟悉,弱弱的咨询个问题。
如果人脸库中有几万张,那一张一张Similarity过去,即便每一次比对只花5ms,最多要比上万张肯定很慢。
有没有办法像数据库查询一样的,对特征数据进行预处理来加快比对效率呢?
还是只能用加机器做分布运行解决了?
i upload my asp.net to server
i got this error ,
Unable to load DLL 'ViewFaceBridge': A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)
anyone can help ?
如题
请问这种怎么处理呢? @View12138
ViewFaceCore 是否支持对比两张人脸是否同一个人?
看到了你的api isSelf 没有看到那点输入两张照片的 api
IIS7 部署会出现Unable to load DLL 'FaceLibraries\x64\ViewFace.dll' or one of its dependencies: 拒绝访问的异常。用的 .net core 3.1
问题描述:造了个单例, 在wpf控件写dispatcher timer , 在timer的tick事件用这个单例去识别人脸, 总是报FatalExecutionEngineError这个错误直接崩溃了, 线程在viewFace.FaceDetector(mybitmap)这里停住了.用windbg查看了内存堆栈,只有一个实例在执行人脸识别.
单例的代码
veiwfacecore版本:0.3.4
public class FaceCaptureViewModel
{
public ViewFace viewFace = new ViewFace("./FaceLibraries/model/", (str) => { Debug.WriteLine(str); });
public static FaceCaptureViewModel Instance = new FaceCaptureViewModel();
public Action<string> OnFaceBeCapture;
public FaceCaptureViewModel()
{
viewFace.DetectorConfig = new ViewFaceCore.Sharp.Configs.FaceDetectorConfig { FaceSize = 20, MaxWidth = 2000, MaxHeight = 2000, Threshold = 0.9 };
// 系统默认使用的轻量级识别模型。如果对精度有要求,请切换到 Normal 模式;并下载需要模型文件 放入生成目录的 model 文件夹中
viewFace.FaceType = FaceType.Normal;
// 系统默认使用5个人脸关键点。//不建议改动,除非是使用口罩模型。
viewFace.MarkType = MarkType.Light;
}
}
调用的代码:
src = (Bitmap)_currentFrame.Clone();
var _result = FaceCaptureViewModel.Instance.viewFace.FaceDetector(src);
@View12138
How much similarity should be so
Confirm the similarity of the two photos ???
0.65 or higher ??
in this function :
float similarity = viewFace.Similarity(oldEigenValues, newEigenValues);
1.多次调用ViewFace.FaceDetectorAsync方法后,有时vs会报这个错误。程序会停止
System.AccessViolationException:“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.”
2.这是控制台的日志信息。
Fatal error. System.AccessViolationException: Attempted to read or write protect
ed memory. This is often an indication that other memory is corrupt.
at ViewFaceCore.Plus.Platform.ViewFacePlus64.ViewDispose()
at ViewFaceCore.Plus.Platform.ViewFacePlus64.ViewDispose()
at ViewFaceCore.Plus.ViewFacePlus.ViewDispose()
at ViewFaceCore.Sharp.ViewFace.Finalize()
Hello:
I found this repo, it seems to be a good software. I want to do some testing.
I have create one Windows Forms App targeting .NET 6.0 (CPU: x64, but x86 has the same error)
I installed latest version of Nuget:
PM> Install-Package ViewFaceCore -Version 0.3.5
The following is my C# code:
using System;
using System.Drawing;
using ViewFaceCore.Sharp;
namespace ViewFaceCoreFaceDetectForm
{
public partial class Form1 : Form
{
public const string Face1_JPG_File = @"D:\Images\Temp\1.jpg";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ViewFace face = new();
Bitmap bitmap = (Bitmap)Image.FromFile(Face1_JPG_File);
var infos = face.FaceDetector(bitmap);
Console.WriteLine($"Face # detected {infos.Length}");
Console.WriteLine($"Score and Position");
for (int i = 0; i < infos.Length; i++)
{
Console.WriteLine($"{i}\t{infos[i].Score:f8}\t{infos[i].Location}");
}
Console.Read();
}
}
}
But when I run this, I got error:
Inner Exception 1:
DirectoryNotFoundException: 找不到本机库目录: C:\SoccerVideos\Images\ViewFaceCoreFaceDetectForm\ViewFaceCoreFaceDetectForm\bin\Debug\net6.0-windows10.0.19041.0\viewfacecore\win\x64
I also download the repo source code (ViewFaceCore-main), and try to build it in Visual Studio 2022 (Version 17.1.1). I am using Windows 10 (Version 21H2, OS build 19044.1586)
But I also got some errors, like the following:
Error MSB8020 The build tools for Remote_GCC_1_0 (Platform Toolset = 'Remote_GCC_1_0') cannot be found. To build using the Remote_GCC_1_0 build tools, please install Remote_GCC_1_0 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".
Error C1083 Cannot open include file: 'seeta/FaceDetector.h': No such file or directory
Let me know how to fix this issue.
PS: You can reply in Chinese, if not easy to reply in English.
I think if I can install NUGET package, all necessary libraries should be OK, there should be no more errors. By the way, if there is any library which is only available in Baidu Pan, then all the people outside China can’t access.
Thanks,
System.DllNotFoundException:“Unable to load DLL 'FaceLibraries\x64\ViewFace.dll' or one of its dependencies: 找不到指定的模块。 (0x8007007E)”
.net 6发布后微软移除了非Windows平台System.Drawing.Common模块的支持,继续使用Bitmap作为接口会导致在linux上无法使用这个库。
事实上Bitmap仅仅只是读取图像信息,这一步很多库都可以做到,比如Silk.Net(opencv),SkiaSharp(skia),不如内置一个ImageInfo,包含width\height\channels\data信息,作为参数,至于用户爱用Bitmap生成这个ImageInfo,还是爱用其他库,随用户自己。
#include "seeta/FaceDetector.h"
#include "seeta/FaceLandmarker.h"
#include "seeta/FaceDatabase.h"
#include "seeta/FaceRecognizer.h"
#include "seeta/Struct_cv.h"
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include
#include
int main() {
seeta::ModelSetting FRsetting;
seeta::ModelSetting FDsetting;
seeta::ModelSetting FLsetting;
FRsetting.set_device(SEETA_DEVICE_GPU);
FRsetting.set_id(0);
FRsetting.append("./models/face_recognizer.csta");
FDsetting.set_device(SEETA_DEVICE_GPU);
FDsetting.set_id(0);
FDsetting.append("./models/face_detector.csta");
FLsetting.set_device(SEETA_DEVICE_GPU);
FLsetting.set_id(0);
FLsetting.append("./models/face_landmarker_pts5.csta");
seeta::FaceDatabase FDB_gpu(FRsetting);
seeta::FaceDetector FD_gpu(FDsetting);
seeta::FaceLandmarker FL_gpu(FLsetting);
seeta::cv::ImageData image1 = cv::imread("./img/huge.jpg");
seeta::cv::ImageData image2 = cv::imread("./img/liuyifei.jpg");
std::cout << "Got image: [" << image1.width << ", " << image1.height << ", " << image1.channels << "]" << std::endl;
seeta::cv::ImageData facedate1(FDB_gpu.GetCropFaceWidthV2(),FDB_gpu.GetCropFaceHeightV2(),FDB_gpu.GetCropFaceChannelsV2());
seeta::cv::ImageData facedate2(FDB_gpu.GetCropFaceWidthV2(),FDB_gpu.GetCropFaceHeightV2(),FDB_gpu.GetCropFaceChannelsV2());
auto faces1 = FD_gpu.detect(image1);
auto points1 = FL_gpu.mark(image1,faces1.data[0].pos);
FDB_gpu.CropFaceV2(image1,points1.data(),facedate1);
auto faces2 = FD_gpu.detect(image2);
auto points2 = FL_gpu.mark(image2,faces2.data[0].pos);
FDB_gpu.CropFaceV2(image2,points2.data(),facedate2);
cv::imwrite("./img/test1.jpg", seeta::cv::ImageData(facedate1).toMat());
cv::imwrite("./img/test2.jpg", seeta::cv::ImageData(facedate2).toMat());
float score1 = FDB_gpu.CompareByCroppedFace(facedate1,facedate2);
std::cout << "score: " << score1 << std::endl;
return 0;
}
结果为:score: -nan
Seeta官方有这个设定,目前ViewFaceCore没有。
求大佬加下License文件。
I use viewfaceCore in asp.net application and it works on local But
when I Published My app and uploaded it to server and it gave this error .
System.IO.DirectoryNotFoundException: 找不到本机库目录: c:\windows\system32\inetsrv\viewfacecore\win\x64
I go to this path
c:\windows\system32\inetsrv\viewfacecore\win\x64
and copy files there .
But it does not solve .
My photo Attach .
在Windows Server 2012 R2 Standard服务器IIS上部署面部识别程序,.netmvc。
多次请求会出现异常停止响应,这种情况偶发多现,当停止响应时,会卡住直到超时,程序中try catch无法捕获。
通过DebugDiag监测clr异常日志如下
`***********************
DetailID = 1
Count: 1
Exception #: 0XC0000005
Stack:
clr!GetMetaDataPublicInterfaceFromInternal+0xc33a
clr!GetMetaDataPublicInterfaceFromInternal+0xbd40
clr!GetMetaDataPublicInterfaceFromInternal+0x1d7e7
clr!GetMetaDataPublicInterfaceFromInternal+0x1a9f2
clr!GetMetaDataPublicInterfaceFromInternal+0x18578
clr!GetMetaDataPublicInterfaceFromInternal+0x191d6
clr!GetMetaDataPublicInterfaceFromInternal+0xc6da
clr!StrongNameSignatureVerification+0x18b06
clr!GetMetaDataPublicInterfaceFromInternal+0xae45
clr!NGenCreateNGenWorker+0xbe05
clr!LogHelp_LogAssert+0x68c5
KERNEL32!BaseThreadInitThunk+0x22
ntdll!RtlUserThreadStart+0x34
|--------------------|
| Count | Exception |
|--------------------|
| 1 | 0XC0000005 |
|--------------------|
Debugging Overhead Cost:
Total Elapsed Ticks = 34437 (100%)
Total Ticks Spent in Debugger Engine = 6984 (20%)
Total Ticks Spent in Crash Rule Script = 2050 (6%)`
0.3.4有了吗?在nuget上找不到啊
研究一天了,都没有运行起来
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.