Spaces:
Running
Running
Update index.html (#1)
Browse files- Update index.html (3c05bea8cfb8f9bf3ac6425055529276993cc160)
- index.html +50 -19
index.html
CHANGED
|
@@ -1,19 +1,50 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>AI Image Checker</title>
|
| 7 |
+
<link rel="stylesheet" href="styles.css">
|
| 8 |
+
</head>
|
| 9 |
+
<body>
|
| 10 |
+
<div class="container">
|
| 11 |
+
<h1>AI Image Checker</h1>
|
| 12 |
+
<form id="image-checker-form" enctype="multipart/form-data">
|
| 13 |
+
<div class="file-input">
|
| 14 |
+
<label for="image-upload">Upload an image to check if it's AI-generated:</label>
|
| 15 |
+
<input type="file" id="image-upload" name="image" accept="image/*" required>
|
| 16 |
+
</div>
|
| 17 |
+
<button type="submit">Check Image</button>
|
| 18 |
+
</form>
|
| 19 |
+
<div id="result" class="result"></div>
|
| 20 |
+
</div>
|
| 21 |
+
|
| 22 |
+
<script>
|
| 23 |
+
const form = document.getElementById('image-checker-form');
|
| 24 |
+
const resultDiv = document.getElementById('result');
|
| 25 |
+
|
| 26 |
+
form.addEventListener('submit', async (e) => {
|
| 27 |
+
e.preventDefault();
|
| 28 |
+
|
| 29 |
+
const formData = new FormData(form);
|
| 30 |
+
resultDiv.textContent = 'Checking...';
|
| 31 |
+
|
| 32 |
+
try {
|
| 33 |
+
const response = await fetch('your_model_endpoint', {
|
| 34 |
+
method: 'POST',
|
| 35 |
+
body: formData
|
| 36 |
+
});
|
| 37 |
+
|
| 38 |
+
const result = await response.json();
|
| 39 |
+
if (result.is_ai_generated) {
|
| 40 |
+
resultDiv.textContent = "This image is AI-generated.";
|
| 41 |
+
} else {
|
| 42 |
+
resultDiv.textContent = "This image is not AI-generated.";
|
| 43 |
+
}
|
| 44 |
+
} catch (error) {
|
| 45 |
+
resultDiv.textContent = "Error occurred while checking the image.";
|
| 46 |
+
}
|
| 47 |
+
});
|
| 48 |
+
</script>
|
| 49 |
+
</body>
|
| 50 |
+
</html>
|