Skip to content

Instantly share code, notes, and snippets.

@sachadee
Created May 10, 2025 19:32
Show Gist options
  • Save sachadee/85c0821857f7175cf5d3c6e42014d53f to your computer and use it in GitHub Desktop.
Save sachadee/85c0821857f7175cf5d3c6e42014d53f to your computer and use it in GitHub Desktop.
OpenVino PaddleOcr inference test
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