Ratings
+
From 7b2bb2514c0e5df9838df4232cc9272baede933e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20Ayd=C4=B1n?= <3feaydin@gmail.com> Date: Thu, 2 May 2019 11:10:25 +0300 Subject: [PATCH] update --- bus_stop/qr_reader/main.py | 57 ++++++++++++++++++ client_side/interface/UserData/ratings.html | 33 ++++++++-- .../interface/UserData/voting_results.html | 10 ++- server_side/api/app.py | 2 +- server_side/api/modules/user_info.py | 17 ++++++ traffic_analyzer/3bug90h684ie.jpg | Bin 0 -> 47297 bytes traffic_analyzer/5y0qqefgf8pm.jpg | Bin 0 -> 56532 bytes traffic_analyzer/6xj0sv03e1rp.jpg | Bin 0 -> 49938 bytes traffic_analyzer/7u38saf39803.jpg | Bin 0 -> 49605 bytes traffic_analyzer/8giefz6t7blg.jpg | Bin 0 -> 57404 bytes traffic_analyzer/9hbgjp8pr9ml.jpg | Bin 0 -> 54685 bytes traffic_analyzer/bhcabz3ylbps.jpg | Bin 0 -> 53056 bytes traffic_analyzer/bka4e0uyj819.jpg | Bin 0 -> 54883 bytes traffic_analyzer/f6tjfpenclkn.jpg | Bin 0 -> 53963 bytes traffic_analyzer/f8tjw066xd8k.jpg | Bin 0 -> 57123 bytes traffic_analyzer/hcw6jsi4snvy.jpg | Bin 0 -> 54819 bytes traffic_analyzer/iyh7h75p89qb.jpg | Bin 0 -> 58022 bytes traffic_analyzer/jmv0qy8gh2hu.jpg | Bin 0 -> 54884 bytes traffic_analyzer/lynlxwlxzovj.jpg | Bin 0 -> 56652 bytes traffic_analyzer/q7xf4ijepqh0.jpg | Bin 0 -> 56641 bytes traffic_analyzer/snpw5fj1pm5y.jpg | Bin 0 -> 57207 bytes traffic_analyzer/traffic.py | 38 ++++++++++++ traffic_analyzer/tsrrxuybcpd8.jpg | Bin 0 -> 54892 bytes traffic_analyzer/wau45wn0y7vr.jpg | Bin 0 -> 57216 bytes 24 files changed, 149 insertions(+), 8 deletions(-) create mode 100644 bus_stop/qr_reader/main.py create mode 100644 traffic_analyzer/3bug90h684ie.jpg create mode 100644 traffic_analyzer/5y0qqefgf8pm.jpg create mode 100644 traffic_analyzer/6xj0sv03e1rp.jpg create mode 100644 traffic_analyzer/7u38saf39803.jpg create mode 100644 traffic_analyzer/8giefz6t7blg.jpg create mode 100644 traffic_analyzer/9hbgjp8pr9ml.jpg create mode 100644 traffic_analyzer/bhcabz3ylbps.jpg create mode 100644 traffic_analyzer/bka4e0uyj819.jpg create mode 100644 traffic_analyzer/f6tjfpenclkn.jpg create mode 100644 traffic_analyzer/f8tjw066xd8k.jpg create mode 100644 traffic_analyzer/hcw6jsi4snvy.jpg create mode 100644 traffic_analyzer/iyh7h75p89qb.jpg create mode 100644 traffic_analyzer/jmv0qy8gh2hu.jpg create mode 100644 traffic_analyzer/lynlxwlxzovj.jpg create mode 100644 traffic_analyzer/q7xf4ijepqh0.jpg create mode 100644 traffic_analyzer/snpw5fj1pm5y.jpg create mode 100644 traffic_analyzer/traffic.py create mode 100644 traffic_analyzer/tsrrxuybcpd8.jpg create mode 100644 traffic_analyzer/wau45wn0y7vr.jpg diff --git a/bus_stop/qr_reader/main.py b/bus_stop/qr_reader/main.py new file mode 100644 index 0000000..335c8d7 --- /dev/null +++ b/bus_stop/qr_reader/main.py @@ -0,0 +1,57 @@ +from imutils.video import VideoStream +from pyzbar import pyzbar +import requests +import imutils +import cv2 + +vs = VideoStream().start() +dates = [] +reps = 0 +barcodes = None +prevcode = None + + +def main(host): + global vs + global dates + global reps + global barcodes + global prevcode + while True: + try: + while (barcodes == None or barcodes == []): + frame = vs.read() + frame = imutils.resize(frame, width=400) + barcodes = pyzbar.decode(frame) + cv2.imshow("Image", frame) + if cv2.waitKey(1) & 0xFF == ord('q'): + break + barcodes = pyzbar.decode(frame) + # loop over the detected barcodes + for barcode in barcodes: + (x, y, w, h) = barcode.rect + cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 0, 255), 2) + + barcodeData = barcode.data.decode("utf-8") + barcodeType = barcode.type + + if (barcodeData != prevcode): + text = "{} ({})".format(barcodeData, barcodeType) + cv2.putText(frame, text, (x, y - 10), cv2.FONT_HERSHEY_SIMPLEX, + 0.5, (0, 0, 255), 2) + + print("[INFO] Found {} barcode: {}".format(barcodeType, barcodeData)) + requests.post('https://' + host + '/reduce', data={'id': barcodeData, 'reduce': 2.5}) + reps += 1 + + prevcode = barcodeData + barcodes = None + cv2.imshow("Image", frame) + if cv2.waitKey(1) & 0xFF == ord('q'): + break + except KeyboardInterrupt: + break +main(input('Host << ')) +print("[INFO] cleaning up...") +cv2.destroyAllWindows() +vs.stop() \ No newline at end of file diff --git a/client_side/interface/UserData/ratings.html b/client_side/interface/UserData/ratings.html index 3f200c7..e7e8412 100644 --- a/client_side/interface/UserData/ratings.html +++ b/client_side/interface/UserData/ratings.html @@ -4,8 +4,16 @@