mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
front end bulk data
This commit is contained in:
parent
cb3ab5c811
commit
1d7b134dc0
@ -11,9 +11,12 @@ nav img {
|
||||
margin-right: auto;
|
||||
height: 32px;
|
||||
}
|
||||
#bulk_rows tr {
|
||||
#bulk_rows td {
|
||||
text-align: center;
|
||||
height: 40px;
|
||||
height: 60px;
|
||||
}
|
||||
#bulk_rows tr:nth-child(even) {
|
||||
background: #DDD
|
||||
}
|
||||
#bulk_rows img {
|
||||
text-align: center;
|
||||
@ -22,4 +25,6 @@ nav img {
|
||||
#bulk_rows {
|
||||
margin: 0 auto;
|
||||
width: 70%;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
@ -15,20 +15,19 @@
|
||||
</table>
|
||||
<script src="../static/js/vendor/jquery.min.js"></script>
|
||||
<script>
|
||||
data = `{"input": "input_2019-04-19-02-56-21.png", "output": {"label": 1}, "message": ""}
|
||||
{"input": "input_2019-04-19-02-56-21.png", "output": {"label": 1}, "message": ""}
|
||||
{"input": "input_2019-04-19-02-56-21.png", "output": {"label": 1, "confidences" : [{"label" : 1, "confidence" : 0.55}]}, "message": ""}`
|
||||
$.get("/static/flagged/data.txt", function(data) {
|
||||
let lines = data.split("\n");
|
||||
lines.forEach((line) => {
|
||||
let row_data = JSON.parse(line);
|
||||
let output = row_data["output"];
|
||||
$("#bulk_rows").append(`
|
||||
<tr class="bulk_row">
|
||||
<td><img src="${row_data["input"]}" /></td>
|
||||
<td><img src="/static/flagged/${row_data["input"]}" /></td>
|
||||
<td class="label">${output["label"] + (output["confidences"] ? ": " + Math.round(100 * output["confidences"][0]["confidence"]) + "%" : "")}</td>
|
||||
</tr>
|
||||
`)
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user