Update index.html
Browse files- index.html +15 -20
index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 12 |
-
|
| 13 |
background: linear-gradient(135deg, #fff0f3 0%, #f3e5f5 100%);
|
| 14 |
margin: 0;
|
| 15 |
padding: 40px 20px;
|
|
@@ -24,13 +24,13 @@
|
|
| 24 |
padding: 30px;
|
| 25 |
border-radius: 12px;
|
| 26 |
box-shadow: 0 4px 20px rgba(106, 27, 154, 0.15);
|
| 27 |
-
|
| 28 |
border-top: 6px solid #8e24aa;
|
| 29 |
}
|
| 30 |
|
| 31 |
h1 {
|
| 32 |
text-align: center;
|
| 33 |
-
color: #8e24aa;
|
| 34 |
margin-top: 0;
|
| 35 |
}
|
| 36 |
|
|
@@ -107,7 +107,7 @@
|
|
| 107 |
}
|
| 108 |
|
| 109 |
button:hover {
|
| 110 |
-
background: #b71c1c;
|
| 111 |
}
|
| 112 |
|
| 113 |
button:active {
|
|
@@ -124,19 +124,19 @@
|
|
| 124 |
#status {
|
| 125 |
margin-top: 25px;
|
| 126 |
padding: 15px;
|
| 127 |
-
background: #f3e5f5;
|
| 128 |
border-radius: 8px;
|
| 129 |
text-align: center;
|
| 130 |
font-size: 16px;
|
| 131 |
-
color: #6a1b9a;
|
| 132 |
font-weight: 500;
|
| 133 |
}
|
| 134 |
|
| 135 |
.resultado-box {
|
| 136 |
margin-top: 15px;
|
| 137 |
padding: 15px;
|
| 138 |
-
background: #fff8f8;
|
| 139 |
-
border-left: 5px solid #e53935;
|
| 140 |
border-radius: 6px;
|
| 141 |
}
|
| 142 |
|
|
@@ -173,19 +173,19 @@
|
|
| 173 |
</div>
|
| 174 |
</div>
|
| 175 |
|
| 176 |
-
|
| 177 |
<div class="form-group">
|
| 178 |
<label for="prompt">2. Texto inicial (Condicional):</label>
|
| 179 |
<input type="text" id="prompt" value="a photography of a" placeholder="Ex: a photography of a">
|
| 180 |
</div>
|
| 181 |
|
| 182 |
-
|
| 183 |
<button id="botao" onclick="gerarLegendas()">Gerar legendas</button>
|
| 184 |
|
| 185 |
-
|
| 186 |
<div id="status">Carregando modelo BLIP Base (Leve)... Aguarde.</div>
|
| 187 |
|
| 188 |
-
|
| 189 |
<div id="resultados" style="display: none;">
|
| 190 |
<div class="resultado-box">
|
| 191 |
<div class="resultado-title">Resultado Condicional</div>
|
|
@@ -209,7 +209,7 @@
|
|
| 209 |
const statusDiv = document.getElementById("status");
|
| 210 |
const botao = document.getElementById("botao");
|
| 211 |
|
| 212 |
-
|
| 213 |
inputImagem.addEventListener("change", (e) => {
|
| 214 |
const file = e.target.files[0];
|
| 215 |
if (file) {
|
|
@@ -221,9 +221,6 @@
|
|
| 221 |
}
|
| 222 |
});
|
| 223 |
|
| 224 |
-
// ======================================
|
| 225 |
-
// CARREGAMENTO DO MODELO (VERSÃO BASE - LEVE)
|
| 226 |
-
// ======================================
|
| 227 |
try {
|
| 228 |
// Usando a versão "base" que é muito menor (~250MB quantizada)
|
| 229 |
captioner = await pipeline(
|
|
@@ -234,12 +231,10 @@
|
|
| 234 |
statusDiv.innerHTML = "✅ Modelo carregado. Selecione uma imagem e clique em Gerar!";
|
| 235 |
} catch (erro) {
|
| 236 |
console.error(erro);
|
| 237 |
-
|
| 238 |
}
|
| 239 |
|
| 240 |
-
|
| 241 |
-
// FUNÇÃO DE GERAÇÃO DE LEGENDAS
|
| 242 |
-
// ======================================
|
| 243 |
window.gerarLegendas = async function () {
|
| 244 |
if (!captioner) {
|
| 245 |
alert("O modelo ainda está sendo carregado. Por favor, aguarde.");
|
|
|
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 12 |
+
|
| 13 |
background: linear-gradient(135deg, #fff0f3 0%, #f3e5f5 100%);
|
| 14 |
margin: 0;
|
| 15 |
padding: 40px 20px;
|
|
|
|
| 24 |
padding: 30px;
|
| 25 |
border-radius: 12px;
|
| 26 |
box-shadow: 0 4px 20px rgba(106, 27, 154, 0.15);
|
| 27 |
+
|
| 28 |
border-top: 6px solid #8e24aa;
|
| 29 |
}
|
| 30 |
|
| 31 |
h1 {
|
| 32 |
text-align: center;
|
| 33 |
+
color: #8e24aa;
|
| 34 |
margin-top: 0;
|
| 35 |
}
|
| 36 |
|
|
|
|
| 107 |
}
|
| 108 |
|
| 109 |
button:hover {
|
| 110 |
+
background: #b71c1c;
|
| 111 |
}
|
| 112 |
|
| 113 |
button:active {
|
|
|
|
| 124 |
#status {
|
| 125 |
margin-top: 25px;
|
| 126 |
padding: 15px;
|
| 127 |
+
background: #f3e5f5;
|
| 128 |
border-radius: 8px;
|
| 129 |
text-align: center;
|
| 130 |
font-size: 16px;
|
| 131 |
+
color: #6a1b9a;
|
| 132 |
font-weight: 500;
|
| 133 |
}
|
| 134 |
|
| 135 |
.resultado-box {
|
| 136 |
margin-top: 15px;
|
| 137 |
padding: 15px;
|
| 138 |
+
background: #fff8f8;
|
| 139 |
+
border-left: 5px solid #e53935;
|
| 140 |
border-radius: 6px;
|
| 141 |
}
|
| 142 |
|
|
|
|
| 173 |
</div>
|
| 174 |
</div>
|
| 175 |
|
| 176 |
+
|
| 177 |
<div class="form-group">
|
| 178 |
<label for="prompt">2. Texto inicial (Condicional):</label>
|
| 179 |
<input type="text" id="prompt" value="a photography of a" placeholder="Ex: a photography of a">
|
| 180 |
</div>
|
| 181 |
|
| 182 |
+
|
| 183 |
<button id="botao" onclick="gerarLegendas()">Gerar legendas</button>
|
| 184 |
|
| 185 |
+
|
| 186 |
<div id="status">Carregando modelo BLIP Base (Leve)... Aguarde.</div>
|
| 187 |
|
| 188 |
+
|
| 189 |
<div id="resultados" style="display: none;">
|
| 190 |
<div class="resultado-box">
|
| 191 |
<div class="resultado-title">Resultado Condicional</div>
|
|
|
|
| 209 |
const statusDiv = document.getElementById("status");
|
| 210 |
const botao = document.getElementById("botao");
|
| 211 |
|
| 212 |
+
|
| 213 |
inputImagem.addEventListener("change", (e) => {
|
| 214 |
const file = e.target.files[0];
|
| 215 |
if (file) {
|
|
|
|
| 221 |
}
|
| 222 |
});
|
| 223 |
|
|
|
|
|
|
|
|
|
|
| 224 |
try {
|
| 225 |
// Usando a versão "base" que é muito menor (~250MB quantizada)
|
| 226 |
captioner = await pipeline(
|
|
|
|
| 231 |
statusDiv.innerHTML = "✅ Modelo carregado. Selecione uma imagem e clique em Gerar!";
|
| 232 |
} catch (erro) {
|
| 233 |
console.error(erro);
|
| 234 |
+
|
| 235 |
}
|
| 236 |
|
| 237 |
+
|
|
|
|
|
|
|
| 238 |
window.gerarLegendas = async function () {
|
| 239 |
if (!captioner) {
|
| 240 |
alert("O modelo ainda está sendo carregado. Por favor, aguarde.");
|