def __init__(self, use_tflite: bool = True, top=OBJECTIVE_TOP_LIVE) -> None:
        self.top = top
        if use_tflite:
            from overtrack_cv.core.tflite import TFLiteModel

            self.model = TFLiteModel(os.path.join(os.path.dirname(__file__), "data", "parse_objective.tflite"))
        else:
            from overtrack_cv.core.tf import load_model

            self.model = load_model(os.path.join(os.path.dirname(__file__), "data", "v18"))
Ejemplo n.º 2
0
    def __init__(self, use_tflite: bool = True):
        if use_tflite:
            from overtrack_cv.core.tflite import TFLiteModel

            self.model = TFLiteModel(
                os.path.join(os.path.dirname(__file__), "data",
                             "big_noodle.tflite"))
        else:
            from overtrack_cv.core.tf import load_model

            self.model = load_model(
                os.path.join(os.path.dirname(__file__), "data", "big_noodle"))
    def __init__(self):
        import tensorflow as tf
        from tensorflow.python.keras import Model

        from overtrack_cv.core.tf import (
            all_custom_objects,
            decode_ctc,
            deserialize,
            load_model,
        )

        self.extract: Model = load_model(
            os.path.join(os.path.dirname(__file__), "data", "extract_v14"))

        model_path = os.path.join(os.path.dirname(__file__), "data",
                                  "parse_v6")
        with open(model_path + "/assets/saved_model.json") as f:
            self.parse_config = json.load(f)
        self.parse_config["config"]["layers"][0]["config"][
            "batch_input_shape"][2] = None
        del self.parse_config["config"]["layers"][0]["config"]["ragged"]
        self.parse: Model = deserialize(self.parse_config,
                                        custom_objects=all_custom_objects)
        self.parse.load_weights(model_path + "/variables/variables")
        self.parse.trainable = False
        with open(model_path + "/outputs.json") as f:
            self.outputs = json.load(f)["outputs"]
            self.outputs_dict = {o["name"]: o for o in self.outputs}
        self.parse_layer_defs = {
            layer["name"]: layer
            for layer in self.parse_config["config"]["layers"]
        }
        # self.parse.outputs += [
        #     tf.keras.layers.Activation('softmax', name='heroes_softmax')(self.parse.outputs[1]),
        #     # tf.nn.softmax(self.parse.outputs[1]),  # hero_softmax
        # ]
        # self.parse.build((None, 50, 600, 3))

        self._decode_ctc = decode_ctc
        self._softmax = tf.nn.softmax
Ejemplo n.º 4
0
    def __init__(self, use_tflite: bool = True):
        self.map_rotated = deque(maxlen=10)
        self.map_rotate_in_config = None
        if use_tflite:
            from overtrack_cv.core.tflite import TFLiteModel

            self.model = TFLiteModel(
                os.path.join(os.path.dirname(__file__), "data",
                             "minimap_filter.tflite"))
        else:
            from overtrack_cv.core.tf import load_model

            self.model = load_model(
                os.path.join(os.path.dirname(__file__), "data",
                             "minimap_filter")
                # "C:/Users/simon/overtrack_2/training/apex_minimap/v3/v15/checkpoint"
            )
            # from tensorflow.python.keras.saving import export_saved_model
            # export_saved_model(self.model, os.path.join(os.path.dirname(__file__), 'data', 'minimap_filter'), serving_only=True)

        self.current_game: Optional[CurrentGame] = None
        self.current_composite: Optional[RingsComposite] = None
Ejemplo n.º 5
0
 def __init__(self):
     self.model: Model = load_model(
         os.path.join(os.path.dirname(__file__), "data", "big_noodle_ctc"))