I am creating a face-recognition system with javascript, PHP and MySQL. The problem I have is I don't know how I will load the image from the database and replace the fetchImage() for something on the disk or MySQL database. I am using XAMPP and localhost.
This is my PHP script:
$result = $mysqli->query("SELECT * FROM student WHERE email = '$user'");
$row = mysqli_fetch_assoc($result);;
$num = $row['stud_num'];
$name = $row['full_name'];
$image = $row['img_name'];
$image_src = "upload/".$image;
then this is for the face recognition
for (let i = 1; i <= 2; i++) {
const img = await faceapi.fetchImage(`https://raw.githubusercontent.com/WebDevSimplified/Face-Recognition-JavaScript/master/labeled_images/${label}/${i}.jpg`)
const detections = await faceapi.detectSingleFace(img).withFaceLandmarks().withFaceDescriptor()
descriptions.push(detections.descriptor)
}
I want to change the fetch image since the