@George_Soloupis if i simply use like this ,
cv2.namedWindow("preview")
cap = cv2.VideoCapture(0)
while (True):
    _, frame = cap.read()
    image  = cv2.resize(frame,(256,256)) 
    image  = cv2.cvtColor(image , cv2.COLOR_BGR2RGBA)
    image  = (image /255.0).astype(np.float32)
    final_result  = run_inference(np.expand_dims(image[:,:,:3], axis=0))
    cv2.imshow("preview", final_result)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()
cv2.destroyWindow("preview")

It’s working fine but when using it in flask it’s showing an error !!