I am trying to implement the face-api.js in a simple project hosted on a local IIS but I am getting the following issue
here is my javascript code
Promise.all([
faceapi.nets.faceRecognitionNet.loadFromUri('/models'),
faceapi.nets.faceLandmark68Net.loadFromUri('/models'),
faceapi.nets.ssdMobilenetv1.loadFromUri('/models')
]).then(start)
I added my website on IIS as follow and add a custom domain in the host file and I am browsing the website as follow: http://facelocal/index.html
Also my hierarchy looks like the following
The response is the following:
Can anyone help me figure out this issue?
The error message is quite clear.
HTTP error 404.3
is a specific error in IIS: MIME type restriction.
IIS needs to know what content type to respond to static files without extension (like your model files).
Since it's undefined by default, you need to set a MIME type for extension-less static files.
Put the following web.config
file in your web application's root folder or update the existing one by adding nodes remove
and mimeMap
respectively under configuration/system.webServer/staticContent
.
I don't know what should be your model file MIME type, so assumed it was text/plain
.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<!-- "." means no extension -->
<!-- to prevent future duplication errors, remove "." mime map in case a higher level configuration is defined somewhere in the web server tree -->
<remove fileExtension="." />
<!-- now add the mime map again -->
<mimeMap fileExtension="." mimeType="text/plain" />
</staticContent>
</system.webServer>
</configuration>
If you manage to configure this, those 404.3
errors will not occur again.