-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_embeddings.php
executable file
·69 lines (58 loc) · 1.63 KB
/
generate_embeddings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
include "index.php";
//$path=pathinfo($_GET["file"]);
//echo $path['filename'];
?>
<div class=content>
<div class=data>
<div class=inner-data>
<center><h1><u>Face Recognition System</u></h1></center>
<?php
$m=$_GET["file"];
$embedding = `python python/generate_embeddings.py {$m} 2>&1`;
//echo $embedding;
if($embedding){
echo "<br>Encodings generated!";
}
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "face_recognition";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "INSERT INTO encodings (Name, Encoding)
VALUES ('".$_GET["file"]."', '".$embedding."')";
if (mysqli_query($conn, $sql)) {
echo "<br>Encoding saved successfully!";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
<Br>
<Br>
Click to go to <a href=#>recognition</a>.
</div>
</div>
</div>
<style>
body{
background-color:rgb(230,230,230);
}
.content{
margin-top:51px;
}
.data{
margin:40px;
margin-top:60px;
background-color:rgb(200,200,200);
}
.inner-data{
margin:40px;
font-size:20px;
}
</style>