File size: 2,761 Bytes
aa1c1e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>🧩 Object Cutter</title>
    <link rel="icon" href="/static/favicon.ico" type="image/x-icon">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        body {
            background-color: #1e1e1e;
            color: #e0e0e0;
            font-family: Arial, sans-serif;
            margin: 0;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .wrapper {
            text-align: center;
            width: 100%;
            max-width: 400px;
        }

        h1 {
            color: #a0ffaf;
            font-size: 28px;
            margin-bottom: 30px;
        }

        form {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        input[type="text"],
        input[type="file"] {
            padding: 10px;
            background-color: #2b2b2b;
            border: 1px solid #444;
            color: #fff;
            border-radius: 5px;
        }

        input[type="submit"] {
            padding: 10px;
            background-color: #3e8e41;
            color: white;
            border: none;
            cursor: pointer;
            border-radius: 5px;
        }

        input[type="submit"]:hover {
            background-color: #367635;
        }

        .loading {
            display: none;
            margin-top: 20px;
            font-size: 16px;
            color: #a0ffaf;
        }

        .spinner {
            border: 4px solid #2b2b2b;
            border-top: 4px solid #3e8e41;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            animation: spin 1s linear infinite;
            margin: 10px auto;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
</head>
<body>
<div class="wrapper">
    <h1>🧩 Object Cutter</h1>
    <form action="/process" method="post" enctype="multipart/form-data" onsubmit="showLoading()">
        <label for="image">Choose image:</label>
        <input type="file" id="image" name="image" accept="image/*" required>

        <label for="prompt">Object description (prompt):</label>
        <input type="text" id="prompt" name="prompt" placeholder="e.g., a glass of water" required>

        <input type="submit" value="Run Detection">
    </form>
    <div class="loading" id="loading">
        <div class="spinner"></div>
        Processing...
    </div>
</div>

<script>
    function showLoading() {
        document.getElementById('loading').style.display = 'block';
    }
</script>
</body>
</html>