Upcoming maintenance: Thursday 21 August @ 12:00-14:00 CEST.

Skip to content
Snippets Groups Projects
Commit 954c91ea authored by Luis de la Cal's avatar Luis de la Cal
Browse files

Testing addition of feature metadata to onnx model

parent fccc0553
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!93Updated L3 components + scalability
This diff is collapsed.
This diff is collapsed.
get-pip.py 0 → 100644
This diff is collapsed.
......@@ -19,7 +19,6 @@ from datetime import timedelta
import os
import numpy as np
import onnxruntime as rt
import onnx as ox
import logging
import time
......@@ -44,7 +43,7 @@ import uuid
LOGGER = logging.getLogger(__name__)
current_dir = os.path.dirname(os.path.abspath(__file__))
MODEL_FILE = os.path.join(current_dir, "ml_model/crypto_5g_rf_spider_features.onnx")
MODEL_FILE = os.path.join(current_dir, "ml_model/crypto_auto_features.onnx")
class l3_centralizedattackdetectorServiceServicerImpl(L3CentralizedattackdetectorServicer):
......@@ -56,20 +55,13 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto
def __init__(self):
LOGGER.info("Creating Centralized Attack Detector Service")
onnx_model = ox.load_model(MODEL_FILE)
meta = onnx_model.metadata_props.add()
meta.key = "key"
meta.value = "value"
LOGGER.debug(onnx_model.metadata_props[0])
self.inference_values = []
self.inference_results = []
self.model = rt.InferenceSession(MODEL_FILE)
'''self.model._model_meta = metadata_proto
meta = self.model.get_modelmeta()
LOGGER.debug(meta.description)
time.sleep(10)'''
LOGGER.debug(meta.custom_metadata_map)
LOGGER.debug("Prueba onnx")
self.input_name = self.model.get_inputs()[0].name
self.label_name = self.model.get_outputs()[0].name
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment