def __init__(self, is_site): # load classifier if (is_site): self.model = SiteModel( "light_classification/models/frozen_inference_graph.pb") else: self.model = SimModel()
def run(): from sim_model import SimModel from sim_array import SimArray pstudy = SimArray(sim_model=SimModel()) pstudy_view = SimArrayView(model=pstudy) pstudy_view.configure_traits()
def __init__(self, scenario): if scenario == "sim": self.model = SimModel() else: # self.model = RealModel("light_classification/models/tl_model") self.model = RealModel( "light_classification/models/frozen_inference_graph.pb")
def __init__(self, scenario): if scenario == "sim": self.model = SimModel() else: # self.model = RealModel("light_classification/models/tl_model") self.model = RealModel( "light_classification/frozen_models/faster_rcnn_resnet101_coco_2018_01_28/frozen_inference_graph.pb" )
def run(): from sim_model import SimModel sim_array = SimArray(sim_model=SimModel()) print sim_array.levels2run[:, 0, 0, 0] print sim_array[:, 0, 0, 0] print sim_array.run_table[0] print 'array_content', sim_array.output_array[0, 0, 0, 0, :] sim_array.clear_cache() print 'array_content', sim_array.output_array[0, 0, 0, 0, :] sim_array.configure_traits()
def __init__(self, is_sim): self.is_sim = is_sim if is_sim: self.model = SimModel() else: self.threshold = THRESHOLD self.graph = self.load_graph(GRAPH_PATH_SIM) self.image_tensor = self.graph.get_tensor_by_name('image_tensor:0') self.detect_boxes = self.graph.get_tensor_by_name( 'detection_boxes:0') self.detect_scores = self.graph.get_tensor_by_name( 'detection_scores:0') self.detect_classes = self.graph.get_tensor_by_name( 'detection_classes:0') self.num_detections = self.graph.get_tensor_by_name( 'num_detections:0') self.sess = tf.Session(graph=self.graph)
# A trait is regarded as Factor if it specifies # a set of levels in form ps_levels = True. # - get_sim_outputs() as instances of SimOut class # defining the name and order of outputs # - peval() method returning a vector of results # the order of outputs is prescribed by the # specification given in the get_outputs() method # # Here we just import predefined Foo model with three four inputs # # [ index_1, material_model, param_1, param_2 ] # # The inputs have the types [ Int, Callable, Float, Float # from sim_model import SimModel sim_model = SimModel() # The model response is obtained by issuing # print 'default evaluation', sim_model.peval() # returning an array with two values. # In this call, the default values of the factors # [input_1, material_model, param_1, param_2 ] # were taken. The factor levels were ignored. # DEFINING A STUDY # -------------- # In order to study the response of the model in a broader range # of specified levels we now construct the parametric study #
def run(): from sim_model import SimModel pstudy_app = SimPStudy(sim_model=SimModel()) pstudy_app.configure_traits(kind='live')
def _sim_model_default(self): from sim_model import SimModel return SimModel()