• DepthAI-v2
  • Frames in OAK-1 camera to process OCR Prediction

Hi Luxonis Team,
I need help with this question

from depthai_sdk import Previews, FPSHandler
from depthai_sdk.managers import PipelineManager, PreviewManager, BlobManager, NNetManager
import depthai as dai
import cv2

bm = BlobManager(blobPath='patentes.blob')
nm = NNetManager(nnFamily="YOLO", inputSize=(640,640))
nm.readConfig("patentes.json")
pm = PipelineManager()
pm.createColorCam(previewSize=nm.inputSize, xout=True)
fpsHandler = FPSHandler()
pv = PreviewManager(display=[Previews.color.name], fpsHandler=fpsHandler)
nn = nm.createNN(pipeline=pm.pipeline, nodes=pm.nodes, source=Previews.color.name,
blobPath=bm.getBlob(shaves=6, openvinoVersion=pm.pipeline.getOpenVINOVersion(), zooType="depthai"))
pm.addNn(nn)

with dai.Device(pm.pipeline) as device:
pv.createQueues(device)
nm.createQueues(device)
nnData = []
while True:
pv.prepareFrames()
inNn = nm.outputQueue.tryGet()
            
frame=?????

    if inNn is not None:
        nnData = nm.decode(inNn)
        fpsHandler.tick("color")
   
    for d in nnData :
        print(f"{d.__class__} {d.label} {d.confidence} ({d.xmin},{d.xmax}) ({d.ymin},{d.ymax})")
    nm.draw(pv, nnData)
    pv.showFrames()
    if cv2.waitKey(1) == ord('q'):
        break

We have this code, but we don't know how to get the current frame, we made the model we trained on the camera work, but we don't know ¿what will be the frame to process OCR prediction?
Can you help us with this issue please?
Thanks.

  • erik replied to this.

    Hi fernandogranada ,
    I'd suggest to not use depthai-SDK, but rather the API (depthai-python), as current SDK is outdated and we are completely refactoring it.
    Thanks, Erik