A web application built with Blazor Server that uses Insightface API to recognize faces. This application is designed to simulate a visitor registration system, where visitors can fill out an application form and upload their photos. After the application is approved, their faces are captured by a camera and analyzed by the Insightface API to find the visitor's application and update their visitation record.
Watch this video to see a demonstration of the application in action.
https://github.com/neozhu/FacialRecognition/assets/1549611/c2f4486c-e606-4f59-b061-77ee8c74b3ac
Please note that due to limited bandwidth on my virtual host, the application may experience some latency during usage. We apologize for any inconvenience this may cause.
⚠️ This step is crucial if you want to use the CameraStreamer on ServerSide Blazor ⚠️
The data from the JavaScript-Interop is sent through SignalR to the Server, where your C# Code handles the received data. SignalR has a image cap of 32KB (which is tiny, smaller than 150x150 pixels).
This restriction can be bypassed though. In your [ProjectName].Startup.ConfigureServices method, change the following line:
services.AddServerSideBlazor() .AddHubOptions(o => o.MaximumReceiveMessageSize = 100_000_000); // add this The MaximumReceiveMessageSize value indicates the maximum allowed number of bytes that can be sent through SignalR. It could also be set to long.MaxValue, to entirely max out the restriction.
100'000'000 has no significant meaning, it's just a general cap. As an example, a 3-Channel 8-Bit 1920x1080 image has the following size: 3 1920 1080 = 6'220'800 Bytes (this calculation does not take image-compression into account).
⚠️ BlazorCameraStreamer can be used in ServerSide Blazor. In general though, it is not recommended to use on ServerSide, since a lot of data is sent through SignalR which can cause network delays. There is a reason, why Microsoft set the default limit to only 32KB. ⚠️
docker-compose up -d
to start the application.appsettings.json
: This file contains configuration options for the application. You can modify the database connection string, Insightface API key, and other settings here.Contributions are welcome! Please feel free to submit issues and pull requests.
This project is licensed under the MIT License.