code: def process(
      worker_id, read_frame_list, write_frame_list, Global, worker_num
  ):
      known_face_encodings = Global.known_face_encodings
      known_face_names = Global.known_face_names
      while not Global.is_exit:
          # Wait to read
          while (
              Global.read_num != worker_id
              or Global.read_num != prev_id(Global.buff_num, worker_num)
          ):
              # If the user has requested to end the app, then stop waiting for webcam frames
              if Global.is_exit:
                  break
  
              time.sleep(0.01)
  
          # Delay to make the video look smoother
          time.sleep(Global.frame_delay)
  
          # Read a single frame from frame list
          frame_process = read_frame_list[worker_id]
  
          # Expect next worker to read frame
          Global.read_num = next_id(Global.read_num, worker_num)
  
          # Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses)
          rgb_frame = frame_process[:, :, ::-1]
  
          # Find all the faces and face encodings in the frame of video, cost most time
          face_locations = face_recognition.face_locations(rgb_frame)
          face_encodings = face_recognition.face_encodings(
              rgb_frame, face_locations
          )
  
          # Loop through each face in this frame of video
          for (top, right, bottom, left), face_encoding in zip(
              face_locations, face_encodings
          ):
              # See if the face is a match for the known face(s)
              matches = face_recognition.compare_faces(
                  known_face_encodings, face_encoding
              )
  
              name = "Unknown"
  
              # If a match was found in known_face_encodings, just use the first one.
              if True in matches:
                  first_match_index = matches.index(True)
                  name = known_face_names[first_match_index]
  
              # Draw a box around the face
              cv2.rectangle(
                  frame_process,
                  (left, top),
                  (right, bottom),
                  (0, 0, 255),
                  2,
              )
  
              # Draw a label with a name below the face
              cv2.rectangle(
                  frame_process,
                  (left, bottom - 35),
                  (right, bottom),
                  (0, 0, 255),
                  cv2.FILLED,
              )
              font = cv2.FONT_HERSHEY_DUPLEX
              cv2.putText(
                  frame_process,
                  name,
                  (left + 6, bottom - 6),
                  font,
                  1.0,
                  (255, 255, 255),
                  1,
              )
  
          # Wait to write
          while Global.write_num != worker_id:
              time.sleep(0.01)
  
          # Send frame to global
          write_frame_list[worker_id] = frame_process
  
          # Expect next worker to write frame
          Global.write_num = next_id(Global.write_num, worker_num)
  
file_path: face_recognition/examples/facerec_from_webcam_multiprocessing.py
imports: import face_recognition
  import cv2
  from multiprocessing import Process, Manager, cpu_count, set_start_method
  import time
  import numpy
  import threading
  import platform
label_desc: Use image node_id 4 for calling a global function with example usage: process(worker_id, read_frame_list, write_frame_list, Global, worker_num) without return types