File size: 1,680 Bytes
b81c7ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!doctype html>
<html lang="en" data-bs-theme="dark">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Image Classifier</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
  
</head>

<body>

  <center>
    <div class="container my-4">
      <h1 class="fs-2 text"> Image Classifier - Is your image AI generated?</h1>
      <form action="/edit" method="post" enctype="multipart/form-data">
        <div class="mb-3">
          <label for="formFile" class="form-label">Select Image to classify</label>
          <input class="form-control" type="file" name="file" id="formFile">
        </div>

        <button type="submit" class="btn btn-success">Submit</button>
      </form>
    </div>

    <div>
      {% if filename %}
      <div style="padding: 20px;">
        <img src="{{url_for('display_image', filename=filename)}} " style="height: 30%; width: 30%;">
      </div>
      {% endif %}
      <p>
        <h4>
          {% with messages = get_flashed_messages() %}
        {% if messages %}
      <ul class=flashes>
        {% for message in messages %}
        <li>{{ message }}</li>
        {% endfor %}
      </ul>
      {% endif %}
      {% endwith %}
        </h4>
      </p>
    </div>
  </center>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"
    integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz"
    crossorigin="anonymous"></script>
</body>

</html>