File size: 2,282 Bytes
05ec9f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Phân loại Chó - Mèo</title>
    <!-- Import Google Fonts -->
    <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap" rel="stylesheet">
    <style>

        body {

            background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);

            font-family: 'Roboto', sans-serif;

            margin: 0;

            padding: 0;

            color: #333;

        }

        .container {

            max-width: 800px;

            margin: 50px auto;

            background: rgba(255, 255, 255, 0.95);

            padding: 30px;

            border-radius: 10px;

            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

            text-align: center;

        }

        h1 {

            color: #444;

            font-size: 2.5em;

            margin-bottom: 20px;

        }

        form {

            margin: 20px auto;

        }

        input[type="file"] {

            display: block;

            margin: 10px auto;

        }

        input[type="submit"] {

            background: #ff6f61;

            color: #fff;

            border: none;

            padding: 10px 20px;

            border-radius: 5px;

            font-size: 1em;

            cursor: pointer;

            transition: background 0.3s ease;

        }

        input[type="submit"]:hover {

            background: #e65c50;

        }

        img {

            max-width: 300px;

            margin: 20px;

            border: 3px solid #ff6f61;

            border-radius: 8px;

        }

        h3 {

            color: #555;

        }

    </style>
</head>
<body>
    <div class="container">
        <h1>Phân loại Chó - Mèo</h1>
        <form method="POST" enctype="multipart/form-data">
            <input type="file" name="file" accept="image/*">
            <input type="submit" value="Tải lên và Dự đoán">
        </form>

        {% if image_path %}
            <h3>Ảnh tải lên:</h3>
            <img src="{{ url_for('static', filename=image_path) }}" alt="Uploaded Image">
        {% endif %}

        {% if result %}
            <h3>Kết quả: {{ result }}</h3>
        {% endif %}
    </div>
</body>
</html>