File size: 2,002 Bytes
0741f17
caa29c9
 
 
0741f17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
caa29c9
 
0741f17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
caa29c9
 
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
<!-- templates/index.html -->
<!DOCTYPE html>
<html>
<head>
    <title>StyleGAN3 Age Transformation</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }
        .container {
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 20px;
            margin-top: 20px;
        }
        .error {
            color: red;
            margin-bottom: 15px;
        }
        .button {
            background-color: #4CAF50;
            border: none;
            color: white;
            padding: 10px 20px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 16px;
            margin: 10px 2px;
            cursor: pointer;
            border-radius: 4px;
        }
        .file-input {
            margin: 10px 0;
        }
    </style>
</head>
<body>
    <h1>StyleGAN3 Age Transformation</h1>
    <p>Upload a face image to make it look younger using StyleGAN3.</p>
    
    <div class="container">
        {% if error %}
        <div class="error">
            <p>{{ error }}</p>
        </div>
        {% endif %}
        
        <form action="/" method="post" enctype="multipart/form-data">
            <div class="file-input">
                <label for="file">Select image:</label>
                <input type="file" id="file" name="file" accept="image/*">
            </div>
            <input type="submit" value="Transform" class="button">
        </form>
    </div>
    
    <div class="container">
        <h3>Notes:</h3>
        <ul>
            <li>This application works best with front-facing portrait photos.</li>
            <li>The current implementation uses a random latent vector rather than encoding your actual image.</li>
            <li>To get accurate results, a proper encoder would need to be implemented.</li>
        </ul>
    </div>
</body>
</html>