-
Notifications
You must be signed in to change notification settings - Fork 9
/
overspeed.py
43 lines (34 loc) · 959 Bytes
/
overspeed.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import cv2
import dlib
import time
import threading
import math
import os
import requests
from pprint import pprint
import json
# carCascade = cv2.CascadeClassifier('myhaar.xml')
# video = cv2.VideoCapture('../short-test.mp4')
PATH="P:/hackthon/images"
FILE_PATH="P:/hackthon/list.txt"
# WIDTH = 1920
# HEIGHT = 1080
# MIN_WIDTH=100
# MIN_HEIGHT=100
API_KEY='02f97a914ac21efe0f718cc3acbd0ebce3d1dc5e '
def overspeeding(car_id):
with open(PATH+'/3car.jpg', 'rb') as fp:
response = requests.post(
'https://api.platerecognizer.com/v1/plate-reader/',
# Optional
files=dict(upload=fp),
headers={'Authorization':'Token '+API_KEY})
res=response.json()
print(res)
# print(type(res)) #type == dictionary
# print(type(res['results'])) # type==list
# print(len(res['results']))
# print(type( res['results'][0]['box'] ))
# print( res['results'][0]['plate'] )
# print(res['results'][0]['vehicle'])
overspeeding(2)