text: # Copyright 2021 Variscite LTD
  # SPDX-License-Identifier: BSD-3-Clause
  
  from pyvar.ml.engines.armnn import ArmNNInterpreter
  from pyvar.ml.utils.framerate import Framerate
  from pyvar.ml.utils.label import Label
  from pyvar.ml.utils.overlay import Overlay
  from pyvar.ml.utils.resizer import Resizer
  from pyvar.ml.utils.retriever import FTP
  from pyvar.multimedia.helper import Multimedia
  
  ftp = FTP()
  
  if ftp.retrieve_package(category="detection"):
      model_file_path = ftp.model
      label_file_path = ftp.label
  
  labels = Label(label_file_path)
  labels.read_labels("detection")
  
  engine = ArmNNInterpreter(model_file_path, accelerated=True)
  
  resizer = Resizer()
  
  camera = Multimedia("/dev/video1", resolution="vga")
  camera.set_v4l2_config()
  
  framerate = Framerate()
  
  draw = Overlay()
  draw.framerate_info = True
  
  while camera.loop:
      with framerate.fpsit():
          frame = camera.get_frame()
          resizer.resize_frame(frame, engine.input_width, engine.input_height)
  
          engine.set_input(resizer.frame_resized)
          engine.run_inference()
          engine.get_result("detection")
  
          output_frame = draw.info(category="detection",
                                   image=resizer.frame,
                                   top_result=engine.result,
                                   labels=labels.list,
                                   inference_time=engine.inference_time,
                                   model_name=model_file_path,
                                   source_file=camera.dev.name,
                                   fps=framerate.fps)
  
          camera.show("ArmNN: Real Time Detection", output_frame)
  
  camera.destroy()
  