New GUI functional. Lots to clean

This commit is contained in:
2012-08-28 18:06:33 +02:00
parent 25d8c241ca
commit 5622bb8722
2 changed files with 18 additions and 18 deletions

View File

@@ -51,18 +51,11 @@ class FaceMovie(object, Observable, Observer):
out_folder = self.face_params.output_folder out_folder = self.face_params.output_folder
self.out_path = "./data" self.out_path = "./data"
self.out_name = "output" self.out_name = "ivolution"
self.out_format = "avi" self.out_format = "avi"
# updating the out_folder if needed # updating the out_folder if needed
self.check_out_name(out_folder) self.check_out_name(out_folder)
self.face_params.output_folder
self.out_path = "./data"
self.out_name = "output"
self.out_format = "avi"
self.check_out_name(out_folder) # updating the out_folder if needed
self.sort_method = face_params.sort # sorting by name or using metadata (n or e) self.sort_method = face_params.sort # sorting by name or using metadata (n or e)
self.mode = face_params.mode # can be crop or conservative. self.mode = face_params.mode # can be crop or conservative.
### ###

View File

@@ -57,7 +57,8 @@ class IvolutionWindow(IvolutionTemplate, Observer, Observable):
# Defines all our parameters neededfor the facemovie # Defines all our parameters neededfor the facemovie
self.root_fo = "" self.root_fo = ""
self.in_fo = "" # Input folder, where images are located self.in_fo = "" # Input folder, where images are located
self.out_fo = "" # Input folder, where the video will be saved #self.out_fo = "" # Input folder, where the video will be saved
self.out_fo = "C:/Users/jll/Videos" #Default folder for Windows
self.mode = "crop" # type of video to be created self.mode = "crop" # type of video to be created
self.sort = "name" # how image files will be chronologically sorted self.sort = "name" # how image files will be chronologically sorted
self.speed = 1 # Speed of the movie self.speed = 1 # Speed of the movie
@@ -178,13 +179,19 @@ class IvolutionWindow(IvolutionTemplate, Observer, Observable):
""" """
Retrieves all parameters needed for the algorithm to run Retrieves all parameters needed for the algorithm to run
""" """
self.in_fo = self.inputtextbox.GetLabel() + "/" #self.in_fo = self.inputtextbox.GetLabel() + "/"
self.out_fo = self.outputchoosertext.GetLabel() + "/" self.in_fo = "C:\Users\jll\perso\Ivolution\ivolution\data\samples" + "/"
self.param = self.typefacelist.GetValue() self.out_fo = "C:\Users\jll\Videos" + "/"
self.speed = self.videospeedlistChoices.index(self.videospeedlist.GetValue()) # We need and integer between 0 and 2 #self.out_fo = self.outputchoosertext.GetLabel() + "/"
self.param = "frontal_face"
#self.param = self.typefacelist.GetValue()
#self.speed = self.videospeedlistChoices.index(self.videospeedlist.GetValue()) # We need and integer between 0 and 2
self.speed = self.videospeedlistChoices[1]
self.mode = self.get_current_mode() self.mode = "crop"
self.sort = self.get_current_sort() self.sort = "name"
#self.mode = self.get_current_mode()
#self.sort = self.get_current_sort()
# Instantiating the face_params object that will be needed by the facemovie # Instantiating the face_params object that will be needed by the facemovie
par_fo = os.path.join(self.root_fo, get_data("haarcascades")) par_fo = os.path.join(self.root_fo, get_data("haarcascades"))
@@ -263,7 +270,7 @@ class IvolutionWindow(IvolutionTemplate, Observer, Observable):
# big steps performed # big steps performed
wx.MutexGuiEnter() # to avoid thread problems wx.MutexGuiEnter() # to avoid thread problems
self.progressgauge.SetValue(self.gaugerange * float(message[2])) self.progressgauge.SetValue(self.gaugerange * float(message[2]))
self.sb.SetStatusText(message[1], 0) self.statusbar.SetStatusText(message[1], 0)
wx.MutexGuiLeave() wx.MutexGuiLeave()
if float(message[2]) >= 1.0: # 100% of process if float(message[2]) >= 1.0: # 100% of process
@@ -274,13 +281,13 @@ class IvolutionWindow(IvolutionTemplate, Observer, Observable):
elif message[0] == "STATUS": # status label elif message[0] == "STATUS": # status label
if message[1] == "Error": if message[1] == "Error":
wx.MutexGuiEnter() # to avoid thread problems wx.MutexGuiEnter() # to avoid thread problems
self.sb.SetStatusText("Error detected", 0) self.statusbar.SetStatusText("Error detected", 0)
self.progressgauge.SetValue(0) self.progressgauge.SetValue(0)
wx.MutexGuiLeave() wx.MutexGuiLeave()
self.process_running = False self.process_running = False
wx.MutexGuiEnter() # to avoid thread problems wx.MutexGuiEnter() # to avoid thread problems
self.sb.SetStatusText(message[1], 1) self.statusbar.SetStatusText(message[1], 1)
wx.MutexGuiLeave() wx.MutexGuiLeave()
elif len(message) > 1: # system commands shall be ignored elif len(message) > 1: # system commands shall be ignored