def start(argv):
        from finalGui import gui

        userGui = Tk()
        userGui.title("Casper Yüz Tanıma Sistemi")

        label1 = Label(userGui, width="35", height="8", bg="blue2")

        addPersonLabel = Label(userGui, width="35", height="12", bg="red")

        detectPersonLabel = Label(userGui, width="35", height="12", bg="green")

        removePersonLabel = Label(userGui,
                                  width="35",
                                  height="12",
                                  bg="orange")

        addPersonButton = Button(userGui,
                                 text="Add Person",
                                 command=lambda: CasperFaceID().addPerson())

        detectPersonButton = Button(userGui,
                                    text="Detect Person",
                                    command=lambda: CasperFaceID().detect())

        removePersonButton = Button(userGui,
                                    text="Remove Person",
                                    command=lambda: gui().wantToRemove())

        withPlus = PhotoImage(
            file=
            r"C:\Users\12\PycharmProjects\face_recognition_with__door_open\button icons\with plus.png"
        )
        addPersonButton.config(image=withPlus, compound=BOTTOM)

        withoutPlusTwo = PhotoImage(
            file=
            r"C:\Users\12\PycharmProjects\face_recognition_with__door_open\button icons\without plus two.png"
        )
        detectPersonButton.config(image=withoutPlusTwo, compound=BOTTOM)

        withRedPlus = PhotoImage(
            file=
            r"C:\Users\12\PycharmProjects\face_recognition_with__door_open\button icons\with red plus.png"
        )
        removePersonButton.config(image=withRedPlus, compound=BOTTOM)

        #casperLogo = PhotoImage(file=r"C:\Users\12\PycharmProjects\face_recognition_with__door_open\button icons\casper logo.png")
        #label1.config(image=casperLogo)

        addPersonButton.grid(row=1, column=0)
        detectPersonButton.grid(row=1, column=1)
        removePersonButton.grid(row=1, column=2)

        label1.grid(row=0, column=0)
        addPersonLabel.grid(row=1, column=0)
        detectPersonLabel.grid(row=1, column=1)
        removePersonLabel.grid(row=1, column=2)

        userGui.mainloop()
Пример #2
0
    def start(argv):
        userGui = tk.Tk()

        userGui.title("Casper Face Recognition")

        tk.Label(userGui, text="Lock - Pass").pack()
        tk.Button(userGui,
                  text="Add Person",
                  command=lambda: CasperFaceID().addPerson()).pack()
        tk.Button(userGui,
                  text="Detect Person",
                  command=lambda: CasperFaceID().detect()).pack()

        userGui.mainloop()
 def start(argv):
     # Declaring GUI variable
     userGui = tk.Tk()
     # Initializing borders
     xSize , ySize = 355, 600
     # Store them in one variable
     size = str(ySize) + "x" + str(xSize)
     # Initialize it to GUI
     userGui.geometry(size)
     # Initialize a title for GUI
     userGui.title("Casper Yüz Tanıma Sistemi")
     # White window color
     userGui.configure(bg="white")
     # Initializing template which is 2x1
     for r in range(2):
         for c in range(1):
             if r == 1:
                 Label(userGui, bg='red').grid(row=r, column=c, padx=300, pady=0)
             else:
                 Label(userGui, bg='blue').grid(row=r, column=c, padx=300, pady=0)
     # Declaring and initializing label which is going to store casper variable
     casperLabel = Label(userGui)
     # Declaring and initializing add person button
     addPersonButton = Button(userGui, text="Add Person", command=lambda: CasperFaceID().addPerson(), bg="blue2",font="STIXGeneral")
     # Declaring and initializing detect person button
     detectPersonButton = Button(userGui, text="Detect Person", command=lambda: CasperFaceID().detect(), bg="blue2",font="STIXGeneral")
     # Declaring and initializing remove person button
     removePersonButton = Button(userGui, text="Remove Person", command=lambda: gui().wantToRemove(), bg="blue2",font="STIXGeneral")
     # Initializing icon for buttons and initialize it to button
     withPlus = PhotoImage(file="button icons/with plus.png")
     addPersonButton.config(image=withPlus, compound=BOTTOM)
     # Initializing icon for buttons and initialize it to button
     withoutPlusTwo = PhotoImage(file="button icons/without plus two.png")
     detectPersonButton.config(image=withoutPlusTwo, compound=BOTTOM)
     # Initializing icon for buttons and initialize it to button
     withRedPlus = PhotoImage(file="button icons/with red plus.png")
     removePersonButton.config(image=withRedPlus, compound=BOTTOM)
     # Initializing icon for buttons and initialize it to button
     casperLogo = PhotoImage(file="button icons/casper_logo.png")
     casperLabel.config(image=casperLogo, compound=BOTTOM)
     # Place them to their locations
     casperLabel.grid(row=0, column=0)
     addPersonButton.grid(row=1, column=0, sticky='W')
     detectPersonButton.grid(row=1, column=0)
     removePersonButton.grid(row=1, column=0, sticky='E')
     # Maimloop for GUI
     userGui.mainloop()
    def wantToRemove(self):
        from finalGui import gui
        answer = filedialog.askdirectory(
            initialdir=
            r"C:\Users\12\PycharmProjects\face_recognition_with__door_open\database"
        )

        if not answer:
            messagebox.showinfo("Information", "No one is removed")
        else:
            CasperFaceID().remove(answer)
Пример #5
0
    def wantToRemove(self):

        answer = filedialog.askdirectory(initialdir=r"C:\Users\12\PycharmProjects\face_recognition_with__door_open\database")
        if not answer:
            messagebox.showinfo("Information", "No one is removed")
        else:
            name = answer.split("/")[6]
            yesNo = messagebox.askyesno("Warning!", "Are you going to delete '"+name+"' ?")
            if yesNo:
                CasperFaceID().remove(answer)
            else:
                messagebox.showinfo("Information", "No one is removed")
Пример #6
0
    def start(argv):
        nRow = None
        nCol = None

        userGui = tk.Tk()
        xSize, ySize = 300, 300
        size = str(ySize) + "x" + str(xSize)
        userGui.geometry(size)
        userGui.title("PASS - LOCK")
        userGui.configure(bg="deep sky blue")

        for r in range(2):
            for c in range(2):
                if r == 0:
                    Label(userGui, bg='red').grid(row=r,
                                                  column=c,
                                                  padx=(xSize / 6) - 15,
                                                  pady=20)
                else:
                    Label(userGui, bg='blue',
                          text="test").grid(row=r,
                                            column=c,
                                            padx=0,
                                            pady=(ySize / 2))

        addPersonButton = Button(userGui,
                                 text='Add Person',
                                 command=lambda: CasperFaceID().addPerson(),
                                 borderwidth=1,
                                 relief=RAISED)
        addPersonButton.grid(row=1, column=0, sticky='', padx=20, pady=0)

        detectPersonButton = Button(userGui,
                                    text="Detect Person",
                                    command=lambda: CasperFaceID().detect())
        detectPersonButton.grid(row=1, column=1, sticky='', padx=20, pady=20)
        userGui.mainloop()
 def wantToRemove(self):
     # Store the users answer who is going to remove
     answer = filedialog.askdirectory(initialdir="database")
     # If user presses cancel button
     if not answer:
         messagebox.showinfo("Information", "No one is removed")
     # If user selects a folder
     else:
         # Just store the name of that file
         name = answer.split("/")[6]
         # Ask to user one more time
         yesNo = messagebox.askyesno("Warning!", "Are you going to delete '" + name + "' ?")
         # If user presses yes remove the person from database
         if yesNo:
             CasperFaceID().remove(answer)
         # If user presses no nothing happens
         else:
             messagebox.showinfo("Information", "No one is removed")