goldenbrown commited on
Commit
af4e59d
1 Parent(s): 7eadec6

Update index.html (#1)

Browse files

- Update index.html (3c05bea8cfb8f9bf3ac6425055529276993cc160)

Files changed (1) hide show
  1. index.html +50 -19
index.html CHANGED
@@ -1,19 +1,50 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>