I am running this code on jetpack5 the video pipeline does not have any delay without yolov8 but when I intgrate yolov8 there is a constant lag of 1s in the actual and processed feed, any idea whats wrong here?

on the jetson xavier NX, what does tegrastats show when you are running yolov8

RAM 1288/3964MB (lfb 28x4MB) 
SWAP 210/1982MB (cached 20MB) 
CPU [100%@1479,89%@1479,85%@1479,86%@1479] 
EMC_FREQ 0% 
GR3D_FREQ 35% 
PLL@32C CPU@35C PMIC@100C 
GPU@30.5C AO@40.5C thermal@32.25C 
POM_5V_IN 5607/5561 
POM_5V_GPU 118/98 
POM_5V_CPU 2843/2791

also, try and use jetson stats

Is your GPU and CPU maxed out when yolov8 is running?

opencv_color

using opencv

jtop-canny

Make sure that you are using the GPU acceleration (the GPU should show high use, not just the CPU)

@Daniyal_Ahmad also, please post camera model (such as THETA X or Z) and firmware version (example: v2.61.0 on THETA X)