title: How to display two images in each Qlabel PyQt5
body: <p>Hi I'm beginner in PyQt5 and my little project is creating image predictor GUI with PyQt5 Designer to detect if an image is a cat or not by clicking on PREDICT button. I can browse which file I want to predict by Browse file button. The problem is whenever I select a cat image added by browse file button, and click on PREDICT button, image associated with the PREDICT button doesn't appear.</p>
  <p><img src="https://i.stack.imgur.com/bDccX.png" alt="" /></p>
  <p>Documentation about Qlabel doesn't provide me enough clear information to solve this problem.</p>
  <p>Here is my code:</p>
  <pre><code>from PyQt5 import QtCore, QtGui, QtWidgets
  import os
  
  class Ui_MainWindow(object):
  def setupUi(self, MainWindow):
      MainWindow.setObjectName(&quot;MainWindow&quot;)
      MainWindow.resize(1600, 900)
      self.centralwidget = QtWidgets.QWidget(MainWindow)
      self.centralwidget.setObjectName(&quot;centralwidget&quot;)
  
      self.photo = QtWidgets.QLabel(self.centralwidget)
      self.photo.setGeometry(QtCore.QRect(10, 20, 761, 651))
      font = QtGui.QFont()
      font.setPointSize(40)
      self.photo.setFont(font)
      self.photo.setFrameShape(QtWidgets.QFrame.Panel)
      self.photo.setFrameShadow(QtWidgets.QFrame.Sunken)
      self.photo.setLineWidth(5)
      self.photo.setMidLineWidth(0)
      self.photo.setScaledContents(True)
      self.photo.setObjectName(&quot;photo&quot;)
  
      self.browseFile = QtWidgets.QPushButton(self.centralwidget)
      self.browseFile.setGeometry(QtCore.QRect(350, 700, 151, 31))
      font = QtGui.QFont()
      font.setPointSize(10)
      self.browseFile.setFont(font)
      self.browseFile.setObjectName(&quot;browseFile&quot;)
      self.browseFile.clicked.connect(self.browse_file)
  
      self.predict = QtWidgets.QPushButton(self.centralwidget)
      self.predict.setGeometry(QtCore.QRect(670, 750, 231, 61))
      font = QtGui.QFont()
      font.setPointSize(17)
      font.setBold(False)
      font.setWeight(50)
      self.predict.setFont(font)
      self.predict.setObjectName(&quot;predict&quot;)
      self.predict.clicked.connect(self.show_predict)
  
      self.photo2 = QtWidgets.QLabel(self.centralwidget)
      self.photo2.setGeometry(QtCore.QRect(790, 20, 791, 651))
      font = QtGui.QFont()
      font.setPointSize(40)
      self.photo2.setFont(font)
      self.photo2.setFrameShape(QtWidgets.QFrame.Panel)
      self.photo2.setFrameShadow(QtWidgets.QFrame.Sunken)
      self.photo2.setLineWidth(5)
      self.photo2.setScaledContents(True)
      self.photo2.setObjectName(&quot;photo2&quot;)
  
      self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
      self.lineEdit.setGeometry(QtCore.QRect(520, 700, 521, 31))
      self.lineEdit.setObjectName(&quot;lineEdit&quot;)
      MainWindow.setCentralWidget(self.centralwidget)
  
      self.menubar = QtWidgets.QMenuBar(MainWindow)
      self.menubar.setGeometry(QtCore.QRect(0, 0, 1600, 25))
      self.menubar.setObjectName(&quot;menubar&quot;)
      MainWindow.setMenuBar(self.menubar)
  
      self.statusbar = QtWidgets.QStatusBar(MainWindow)
      self.statusbar.setObjectName(&quot;statusbar&quot;)
      MainWindow.setStatusBar(self.statusbar)
  
      self.retranslateUi(MainWindow)
      QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
  def retranslateUi(self, MainWindow):
      _translate = QtCore.QCoreApplication.translate
      MainWindow.setWindowTitle(_translate(&quot;MainWindow&quot;, &quot;MainWindow&quot;))
      self.photo.setText(_translate(&quot;MainWindow&quot;, &quot;INPUT&quot;))
      self.browseFile.setText(_translate(&quot;MainWindow&quot;, &quot;Browse file&quot;))
      self.predict.setText(_translate(&quot;MainWindow&quot;, &quot;PREDICT&quot;))
      self.photo2.setText(_translate(&quot;MainWindow&quot;, &quot;OUTPUT&quot;))
  
  def browse_file(self):
      directory = QtWidgets.QFileDialog.getOpenFileName(None, &quot;Browse File&quot;, &quot;&quot;, &quot;PNG (*.PNG *.png&quot;)[0]
      print(directory)
      pixmap =  QtGui.QPixmap(directory)
      self.photo.setPixmap(pixmap.scaled(self.photo.size()))
      self.lineEdit.setText('{}'.format(directory))
  
  def _set_text(self, text):
      return text
  
  def show_predict(self):
      self.photo2.setPixmap(QtGui.QPixmap(os.path.realpath(&quot;image/predictions.png&quot;)))  
  
  if __name__ == &quot;__main__&quot;:
  import sys
  app = QtWidgets.QApplication(sys.argv)
  MainWindow = QtWidgets.QMainWindow()
  ui = Ui_MainWindow()
  ui.setupUi(MainWindow)
  MainWindow.show()
  sys.exit(app.exec_())
  </code></pre>