code: def initUI(self):
      # set font
      font = QFont()
      font.setPointSize(16)
  
      # widgets
      self.btnStart = QPushButton("Start", self)
      self.btnStart.move(440, 520)
      self.btnStart.setFixedWidth(200)
      self.btnStart.setFixedHeight(50)
      self.btnStart.setFont(font)
      self.btnStart.clicked.connect(self.run)
  
      self.btnOpen = QPushButton("Open", self)
      self.btnOpen.move(230, 520)
      self.btnOpen.setFixedWidth(200)
      self.btnOpen.setFixedHeight(50)
      self.btnOpen.setFont(font)
      self.btnOpen.clicked.connect(self.openFileDialog)
  
      self.cbbInput = QComboBox(self)
      self.cbbInput.addItem("Webcam")
      self.cbbInput.addItem("Video")
      self.cbbInput.setCurrentIndex(0)
      self.cbbInput.setFixedWidth(200)
      self.cbbInput.setFixedHeight(50)
      self.cbbInput.move(20, 520)
      self.cbbInput.setFont(font)
      self.cbbInput.activated.connect(self.selectInput)
      # -------------------
  
      self.lblDisplay = QLabel(self)  # label to show frame from camera
      self.lblDisplay.setGeometry(10, 10, 640, 480)
      self.lblDisplay.setStyleSheet("background-color: #000000")
  
      self.lblROI = QLabel(self)  # label to show face with ROIs
      self.lblROI.setGeometry(660, 10, 200, 200)
      self.lblROI.setStyleSheet("background-color: #000000")
  
      self.lblHR = QLabel(self)  # label to show HR change over time
      self.lblHR.setGeometry(900, 20, 300, 40)
      self.lblHR.setFont(font)
      self.lblHR.setText("Frequency: ")
  
      self.lblHR2 = QLabel(self)  # label to show stable HR
      self.lblHR2.setGeometry(900, 70, 300, 40)
      self.lblHR2.setFont(font)
      self.lblHR2.setText("Heart rate: ")
  
      # self.lbl_Age = QLabel(self) #label to show stable HR
      # self.lbl_Age.setGeometry(900,120,300,40)
      # self.lbl_Age.setFont(font)
      # self.lbl_Age.setText("Age: ")
  
      # self.lbl_Gender = QLabel(self) #label to show stable HR
      # self.lbl_Gender.setGeometry(900,170,300,40)
      # self.lbl_Gender.setFont(font)
      # self.lbl_Gender.setText("Gender: ")
  
      # dynamic plot
      self.signal_Plt = pg.PlotWidget(self)
  
      self.signal_Plt.move(660, 220)
      self.signal_Plt.resize(480, 192)
      self.signal_Plt.setLabel("bottom", "Signal")
  
      self.fft_Plt = pg.PlotWidget(self)
  
      self.fft_Plt.move(660, 425)
      self.fft_Plt.resize(480, 192)
      self.fft_Plt.setLabel("bottom", "FFT")
  
      self.timer = pg.QtCore.QTimer()
      self.timer.timeout.connect(self.update)
      self.timer.start(200)
  
      self.statusBar = QStatusBar()
      self.statusBar.setFont(font)
      self.setStatusBar(self.statusBar)
  
      # config main window
      self.setGeometry(100, 100, 1160, 640)
      # self.center()
      self.setWindowTitle("Heart rate monitor")
      self.show()
  
imports: import cv2
  import numpy
  from PyQt5 import QtCore
  from PyQt5.QtCore import QThread
  from PyQt5.QtGui import QFont, QImage, QPixmap
  from PyQt5.QtWidgets import QPushButton, QApplication, QComboBox, QLabel, QFileDialog, QStatusBar, QDesktopWidget, QMessageBox, QMainWindow
  import pyqtgraph
  import sys
  import time
  from process import Process
  from webcam import Webcam
  from video import Video
  from interface import waitKey, plotXY
label_desc: Use image node_id 2 for calling the GUI obj's underlying member method code with example usage: obj.initUI() without return types