From 514d061e7e37c9395b7fde499173f333a95413a3 Mon Sep 17 00:00:00 2001 From: Jetson Date: Sat, 14 Jan 2023 21:11:36 +0800 Subject: [PATCH] feat: frontend & main controller --- frontend/index.html | 4 ++-- main.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index f12f7ee..67c0b03 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -77,9 +77,9 @@ update(data) { let state = data.state; if (state == "identified") this.type = data.type; - - this.state = state; if (state == "identify") this.imageUrl = `/photo?${Date.now()}` + + this.state = state; }, async polling() { let res, data; diff --git a/main.py b/main.py index 67c190d..d9eea58 100644 --- a/main.py +++ b/main.py @@ -55,7 +55,7 @@ def loop(): print("[+] Sending prediction...") 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("[+] Waiting for finish...") @@ -131,5 +131,5 @@ def test(): while True: - test() - # loop() + # test() + loop()