Created
May 10, 2025 19:32
-
-
Save sachadee/85c0821857f7175cf5d3c6e42014d53f to your computer and use it in GitHub Desktop.
OpenVino PaddleOcr inference test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import cv2 | |
import numpy as np | |
from util import detectionclassOV as net | |
detection = net.Detection("./weights/compiled_detection.blob") | |
def main(): | |
frame = cv2.imread('./images/plate.jpg') | |
image = frame.copy() | |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) | |
points = detection(frame) | |
points = net.sort_polygon(list(points)) | |
# draw detected polygon | |
for point in points: | |
point = np.array(point, dtype=np.int32) | |
cv2.polylines(image, | |
[point], True, | |
(0, 255, 0), 2) | |
cv2.imshow('Detection',image) | |
cv2.waitKey(0) | |
cv2.imwrite('PlateOut.jpg',image) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment