code: def update():
      ret, frame = video_capture.read()
  
      if not ret:
          return
  
      faces_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
      faces = face_cascade.detectMultiScale(
          faces_frame, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30)
      )
  
      img_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA)
      img_frame = img_frame.view(dtype="uint32").reshape(
          frame.shape[:2]
      )
      img_frame = img_frame[
          ::-2, ::2
      ]  # lightly decimate and invert for plotting
  
      if len(faces) == 0:
          rect_source.data = empty_rects
      else:
          # the faces rects origin is top left so we need to fix up
          faces = [
              (x + w / 2, CAMERA_HEIGHT - y - h / 2, w, h)
              for x, y, w, h in faces
          ]
          rect_source.data = dict(
              zip(("x", "y", "w", "h"), zip(*faces))
          )
  
      image_source.data["image"] = [img_frame]
  
      step_source.stream(
          {
              "t": [(dt.now() - t0).total_seconds() * 1000],
              "n": [len(faces)],
          },
          rollover=200,
      )
  
imports: from datetime import datetime
  import cv2
  from bokeh.io import curdoc
  from bokeh.models import ColumnDataSource
  from bokeh.plotting import figure
  from bokeh.sampledata.haar_cascade import frontalface_default_path
label_desc: Use image node_id 1 for calling a global function with example usage: update() without return types