public LayerWrapper CreateLayerFromSeed(string chainName, LayerInfo info, int layerIndex) { Layer toAdd = CopyLayer(Seed); string buildDate = GetLayerBuildDate(LayerDllLocation); try { Dictionary <string, object> parameters = info.Parameters; string intentFilename = chainName + "_" + info.Name + "_" + layerIndex; IRuntimeStorage intent = RuntimeStorage.FromCouchDb(intentFilename); parameters.Add("intent", intent); parameters.Add("shared", sharedLayerData); toAdd.Init(parameters); IEnumerable <string> libnames = toAdd.AnnotationLibraries(); LayerWrapper wrapper = new LayerWrapper(toAdd, parameters, intent, buildDate); return(wrapper); } catch (IOException e) { Console.WriteLine("Could not load layer: " + info.Name); Console.WriteLine("Error Message: " + e.Message); Console.WriteLine("Stack Trace: " + e.StackTrace); return(null); } }
public void Init(Dictionary<string, object> parameters) { if (parameters.ContainsKey("library")) { _annotationLibrary = parameters["library"].ToString(); _runtimeIntent = parameters["intent"] as IRuntimeStorage; } }
public void Init(Dictionary <string, object> parameters) { if (parameters.ContainsKey("library")) { _annotationLibrary = parameters["library"].ToString(); _runtimeIntent = parameters["intent"] as IRuntimeStorage; } }
public RuntimeController(IRuntimeStorage runtime, IActionDispatcher dispatcher, IGrainFactory factory, ILogger <RuntimeController> logger) { this.runtime = runtime; this.dispatcher = dispatcher; this.factory = factory; this.logger = logger; }
public LayerWrapper (Layer layer, Dictionary<string,object> parameters, IRuntimeStorage intent, string id) { this.Layer = layer; this.Id = id; this.Intent = intent; this.Parameters = parameters; }
public LayerWrapper(Layer layer, Dictionary <string, object> parameters, IRuntimeStorage intent, string id) { this.Layer = layer; this.Id = id; this.Intent = intent; this.Parameters = parameters; }
private static void SetConfigId(List <LayerWrapper> layers, int layerIndex) { LayerWrapper layer = layers[layerIndex]; string configid = LayerChain.ConfigurationId(layers, layerIndex); IRuntimeStorage intent = layer.Intent; JObject jobj = new JObject(); jobj["id"] = configid; intent.PutData("config", jobj); }
public void UpdateLogic() { AnnotationUpdateUtility.UpdateInvalidatedLayers(_layers); Storage = RuntimeStorage.FromCouchDb("prefab_single_layer"); var args = new ProcessAnnotationArgs(Storage, GetPtypes()); if (File.Exists(_singleLayerName)) { _interpreter = LoadSingleLayer(_singleLayerName); _interpreter.ProcessAnnotations(args); } }
public List <Ptype> LoadPtypes(IRuntimeStorage intent) { this.intent = intent; ptypeData = LoadPtypesFromIntent(); List <Ptype.Mutable> ptypes = new List <Ptype.Mutable>(); foreach (PtypeMetadata data in ptypeData.Values) { ptypes.Add(data.Ptype); } return(Ptype.CreatePrototypeLibrary(ptypes)); }
private void SavePtypesToIntent(IRuntimeStorage intent, IEnumerable <PtypeMetadata> ptypeData) { JArray array = new JArray(); foreach (PtypeMetadata data in ptypeData) { JObject item = new JObject(); item.Add("id", data.Ptype.Id); item.Add("model", data.Ptype.Model); JArray features = new JArray(); JArray regions = new JArray(); AddFeaturesToJArray(features, data); AddRegionsToJArray(regions, data); item.Add("features", features); item.Add("regions", regions); JArray examples = new JArray(); foreach (Example e in data.Examples) { JObject ejson = new JObject(); ejson.Add("imageId", e.ImageId); ejson.Add("positive", e.IsPositive); JObject region = new JObject(); region.Add("top", e.Region.Top); region.Add("left", e.Region.Left); region.Add("width", e.Region.Width); region.Add("height", e.Region.Height); ejson.Add("region", region); examples.Add(ejson); } item.Add("examples", examples); array.Add(item); } intent.PutData(INTENT_PTYPES, array); }
private void SavePtypesToIntent(IRuntimeStorage intent, IEnumerable<PtypeMetadata> ptypeData){ JArray array = new JArray(); foreach(PtypeMetadata data in ptypeData){ JObject item = new JObject(); item.Add("id", data.Ptype.Id); item.Add("model", data.Ptype.Model); JArray features = new JArray(); JArray regions = new JArray(); AddFeaturesToJArray(features, data); AddRegionsToJArray(regions, data); item.Add("features", features); item.Add("regions", regions); JArray examples = new JArray(); foreach(Example e in data.Examples){ JObject ejson = new JObject(); ejson.Add("imageId", e.ImageId); ejson.Add("positive", e.IsPositive); JObject region = new JObject(); region.Add("top", e.Region.Top); region.Add("left", e.Region.Left); region.Add("width", e.Region.Width); region.Add("height", e.Region.Height); ejson.Add("region", region); examples.Add(ejson); } item.Add("examples", examples); array.Add(item); } intent.PutData(INTENT_PTYPES , array); }
public void Init(Dictionary<string, object> parameters) { intent = (IRuntimeStorage)parameters["intent"]; shared = (Dictionary<string,object>)parameters["shared"]; libraries = new List<string>(); if(parameters.ContainsKey("library")) libraries.Add( (string)parameters["library"] ); try{ ptypeUtil = new PtypeSerializationUtility(); List<Ptype> lib = ptypeUtil.LoadPtypes(intent); shared[SHARED_PTYPES_KEY] = lib; this.featureTree = FeatureTree.FeatureTree.BuildTree(GetFeatures(lib)); }catch(Exception e){ Console.Error.WriteLine(e.StackTrace); } }
public void Init(Dictionary <string, object> parameters) { intent = (IRuntimeStorage)parameters["intent"]; shared = (Dictionary <string, object>)parameters["shared"]; libraries = new List <string>(); if (parameters.ContainsKey("library")) { libraries.Add((string)parameters["library"]); } try{ ptypeUtil = new PtypeSerializationUtility(); List <Ptype> lib = ptypeUtil.LoadPtypes(intent); shared[SHARED_PTYPES_KEY] = lib; this.featureTree = FeatureTree.FeatureTree.BuildTree(GetFeatures(lib)); }catch (Exception e) { Console.Error.WriteLine(e.StackTrace); } }
public ProcessAnnotationArgs(IRuntimeStorage intent, IEnumerable <Ptype> ptypes) { RuntimeStorage = intent; Prototypes = ptypes; }
public PrefabSingleInterpretArgs(MutableTree tree, IRuntimeStorage runtimeStorage) { Tree = tree; RuntimeStorage = new PythonRuntimeStorageWrapper(runtimeStorage); }
public InterpretArgs (Tree tree, Tree.BatchTransform updater, IRuntimeStorage runtimeStorage) { this._updater = updater; Tree = tree; RuntimeStorage = runtimeStorage; }
public DashboardController(IRuntimeStorage runtime, IConfigurationStorage configuration, IGrainFactory factory) { this.runtime = runtime; this.configuration = configuration; this.factory = factory; }
public AnnotationArgs(List<AnnotatedNode> nodes, IRuntimeStorage runtimeStorage) { this.AnnotatedNodes = nodes; this.RuntimeStorage = runtimeStorage; }
public DeleteCommand(RuntimeStorageBrowser window, GridItem item,IRuntimeStorage intent) { _item = item; _window = window; _intent = intent; }
public AnnotationArgs(List <AnnotatedNode> nodes, IRuntimeStorage runtimeStorage) { this.AnnotatedNodes = nodes; this.RuntimeStorage = runtimeStorage; }
public PythonRuntimeStorageWrapper(IRuntimeStorage storage) { RuntimeStorage = storage; }
public List<Ptype> LoadPtypes(IRuntimeStorage intent) { this.intent = intent; ptypeData = LoadPtypesFromIntent(); List<Ptype.Mutable> ptypes = new List<Ptype.Mutable>(); foreach(PtypeMetadata data in ptypeData.Values) ptypes.Add(data.Ptype); return Ptype.CreatePrototypeLibrary(ptypes); }
public ProcessAnnotationArgs(IRuntimeStorage intent, IEnumerable<Ptype> ptypes) { RuntimeStorage = intent; Prototypes = ptypes; }
public DeviceStatusHistoryGrain(IRuntimeStorage runtimeStorage, ILogger <DeviceStatusHistoryGrain> logger) { this.runtimeStorage = runtimeStorage; this.logger = logger; }
public InterpretArgs(Tree tree, Tree.BatchTransform updater, IRuntimeStorage runtimeStorage) { this._updater = updater; Tree = tree; RuntimeStorage = runtimeStorage; }