Skip to content

Commit 2348b69

Browse files
add test modules
1 parent 1a1bb17 commit 2348b69

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/detect_and_recognize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def get_plate_numbers_for_rec_plate(plate_image):
5454
padding[180:290, 0:470, :] = plate_image
5555
# padding = cv2.cvtColor(np.float32(padding), cv2.COLOR_BGR2GRAY)
5656
# padding = cv2.merge((padding, padding, padding))
57-
cv2.imwrite("temp.jpg", padding)
57+
# cv2.imwrite("temp.jpg", padding)
5858
padding_resize = Image.fromarray(np.uint8(padding)).convert('RGB')
5959
# path = "/home/vdtc/ALPR/test_components/data_2022_03_29/plate_image_train/%d.jpg" % image_count
6060
# padding_resize.save(path)

temp.jpg

2.87 KB
Loading

test.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import base64
2+
import time
3+
import requests
4+
5+
6+
imgPath = "/home/datbt/ALPR/data_2022_03_29/camera_bienso/2233785415252557522_1_0_03_20220329021230.jpg"
7+
with open(imgPath, "rb") as image_file:
8+
encodedByte = base64.b64encode(image_file.read())
9+
encodedString = encodedByte.decode('utf-8')
10+
t = time.time()
11+
req = requests.post("http://127.0.0.1:8765/detect_plate_base64", data={"image": encodedString})
12+
t = time.time() - t
13+
print(req.text, t)

0 commit comments

Comments
 (0)