After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 868 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 101 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 128 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 5.1 MiB |
After Width: | Height: | Size: 5.0 MiB |
After Width: | Height: | Size: 6.0 MiB |
After Width: | Height: | Size: 6.3 MiB |
After Width: | Height: | Size: 5.7 MiB |
After Width: | Height: | Size: 6.3 MiB |
After Width: | Height: | Size: 5.3 MiB |
After Width: | Height: | Size: 52 KiB |
@ -0,0 +1 @@
|
||||
<table><tr><th>잚깎</th><th>零斤똑</th></tr><tr><td>瑨叉</td><td>95.4335</td></tr><tr><td>鬼뒈일빪</td><td>1.9126</td></tr><tr><td>圖쵠측</td><td>1.2005</td></tr><tr><td>겜懃빻쏜밴</td><td>1.0906</td></tr><tr><td>댕뒈일빪</td><td>0.2073</td></tr><tr><td>뼝뒈일빪</td><td>0.0621</td></tr><tr><td>譏녔</td><td>0.0485</td></tr><tr><td>쏜濾녔</td><td>0.0193</td></tr><tr><td>庚療측</td><td>0.0087</td></tr><tr><td>迭直</td><td>0.0066</td></tr></table>
|
After Width: | Height: | Size: 897 KiB |
@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>图像分类工具 - 结果页面</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: "SimHei", sans-serif;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 50px; /* 标题放大 */
|
||||
}
|
||||
|
||||
button {
|
||||
margin: 25px;
|
||||
padding: 25px 45px;
|
||||
font-size: 20px; /* 按钮文字放大 */
|
||||
}
|
||||
|
||||
#result {
|
||||
margin-top: 30px;
|
||||
font-size: 24px; /* 结果文字放大 */
|
||||
}
|
||||
|
||||
/* 样式用于显示后端返回的 HTML 结果 */
|
||||
#safe-result {
|
||||
margin-top: 30px;
|
||||
font-size: 24px; /* 结果文字放大 */
|
||||
white-space: pre-line; /* 保持换行 */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>图像分类工具</h1>
|
||||
<input type="file" id="imageInput" accept="image/*" />
|
||||
<button onclick="analyzeImage()">获取分析结果</button>
|
||||
<div id="result"></div>
|
||||
|
||||
<!-- 结果页面中用于显示后端返回的 HTML 内容 -->
|
||||
{% if result %}
|
||||
<div id="safe-result">
|
||||
<!-- 使用 |safe 过滤器来确保 HTML 标签不被转义 -->
|
||||
{{ result|safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<script>
|
||||
async function analyzeImage() {
|
||||
const input = document.getElementById('imageInput');
|
||||
if (!input.files[0]) {
|
||||
alert("请先插入一张图片。");
|
||||
return;
|
||||
}
|
||||
|
||||
// 读取图像
|
||||
const file = input.files[0];
|
||||
const img = new Image();
|
||||
img.src = URL.createObjectURL(file);
|
||||
await img.decode();
|
||||
|
||||
// 此处应调用后端接口进行预测
|
||||
// 示例:假设有一个 API '/api/predict' 返回预测结果
|
||||
const formData = new FormData();
|
||||
formData.append("image", file);
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/predict', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("网络错误");
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
document.getElementById('result').innerText = `具有最大置信度的类别名称:${result.label}`;
|
||||
|
||||
} catch (error) {
|
||||
alert("分析失败:" + error.message);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|