def start(self): self.state = KerasVisAppState(self.net, self.settings, self.bindings, self.net_layer_info) self.state.drawing_stale = True self.layer_print_names = [ get_pretty_layer_name(self.settings, nn) for nn in self.state._layers ] if self.proc_thread is None or not self.proc_thread.is_alive(): # Start thread if it's not already running self.proc_thread = KerasProcThread( self.net, self.graph, self.state, self.settings.kerasvis_frame_wait_sleep, self.settings.kerasvis_pause_after_keys, self.settings.kerasvis_heartbeat_required) self.proc_thread.start() if self.jpgvis_thread is None or not self.jpgvis_thread.is_alive(): # Start thread if it's not already running self.jpgvis_thread = JPGVisLoadingThread( self.settings, self.state, self.img_cache, self.settings.kerasvis_jpg_load_sleep, self.settings.kerasvis_heartbeat_required) self.jpgvis_thread.start()
def start(self): '''Start the application. The start procedure includes creating as an appropriate VisAppState object, a processing thread as well as a jpgvis_thread. The function returns after all those threads have been started. ''' # initialize the application state self.state = VisAppState(self.my_net, self.settings, self.bindings) self.state.drawing_stale = True # get the pretty layer names self.layer_print_names = [ get_pretty_layer_name(self.settings, nn) for nn in self.state._layers ] # start the processing thread if self.proc_thread is None or not self.proc_thread.is_alive(): # Start thread if it's not already running self.proc_thread = ProcThread( self.my_net, self.state, self.settings.caffevis_frame_wait_sleep, self.settings.caffevis_pause_after_keys, self.settings.caffevis_heartbeat_required, self.settings.caffevis_mode_gpu) self.proc_thread.start() # start the image loading thread if self.jpgvis_thread is None or not self.jpgvis_thread.is_alive(): # Start thread if it's not already running self.jpgvis_thread = JPGVisLoadingThread( self.settings, self.state, self.img_cache, self.settings.caffevis_jpg_load_sleep, self.settings.caffevis_heartbeat_required) self.jpgvis_thread.start()