feat: frontend & main controller
This commit is contained in:
parent
77ea4bb6a0
commit
514d061e7e
@ -77,9 +77,9 @@
|
|||||||
update(data) {
|
update(data) {
|
||||||
let state = data.state;
|
let state = data.state;
|
||||||
if (state == "identified") this.type = data.type;
|
if (state == "identified") this.type = data.type;
|
||||||
|
|
||||||
this.state = state;
|
|
||||||
if (state == "identify") this.imageUrl = `/photo?${Date.now()}`
|
if (state == "identify") this.imageUrl = `/photo?${Date.now()}`
|
||||||
|
|
||||||
|
this.state = state;
|
||||||
},
|
},
|
||||||
async polling() {
|
async polling() {
|
||||||
let res, data;
|
let res, data;
|
||||||
|
6
main.py
6
main.py
@ -55,7 +55,7 @@ def loop():
|
|||||||
|
|
||||||
print("[+] Sending prediction...")
|
print("[+] Sending prediction...")
|
||||||
ser.write(bytes([label_idx]))
|
ser.write(bytes([label_idx]))
|
||||||
API(f'/result?{urllib.parse.quote_plus(label_name[label_idx])}')
|
API(f'/result?type={urllib.parse.quote_plus(label_name[label_idx])}')
|
||||||
print("[+] Sent prediction!")
|
print("[+] Sent prediction!")
|
||||||
|
|
||||||
print("[+] Waiting for finish...")
|
print("[+] Waiting for finish...")
|
||||||
@ -131,5 +131,5 @@ def test():
|
|||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
test()
|
# test()
|
||||||
# loop()
|
loop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user