Skip to content
Open

hh #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8010",
"webRoot": "/"
}
]
}
Binary file added docs/123.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>

<body>
<img src="http://p.pstatp.com/avatar/100x100/1dd5000018fab5bd782b.png" id="some_image" crossorigin="anonymous" />
<img src="./docs/123.png" id="some_image" crossorigin="anonymous" />
<input type="button" value="识别" id="test" />
<script src="./net/car.js"></script>
<script src="./net/convnet.js"></script>
Expand Down Expand Up @@ -76,7 +76,7 @@
// 告诉机器每一类对应的是什么(即让机器认识图片的过程)
const carNameList = ["奥迪", "奔驰", "宝马", "本田", "别克", "比亚迪", "保时捷", "大众", "哈弗"];
const x = convnetjs.img_to_vol(document.getElementById('some_image'));
// console.log(net.forward(x));
console.log(net.forward(x),x);
const result = Array.from(net.forward(x).w);
let max = Math.max.apply(Math, result);
console.log("最有可能的那个汽车logo🚗", carNameList[result.indexOf(max)])
Expand Down