//Some annotations might be updated with an old library and others might be updated with a new one. public static void UpdateInvalidatedLayers(List<LayerWrapper> layers) { //Initialize the intermediate interpretations Dictionary<string, InterpretationFromImage> interps = InitializeInterpretations(layers); string configId = LayerChain.ConfigurationId(layers, -1); LayerWrapper currLayer = null; //For each layer, re-interpret the captured images for its annotations //and let the layer recompute any data for them try { for (int i = 0; i < layers.Count; i++) { currLayer = layers[i]; //Check if the layer is invalidated string layerConfigId = GetPreviousConfigId(currLayer); if (!configId.StartsWith(layerConfigId)) { List<AnnotatedNode> nodes = NodesFromImageAnnotations(layers, i - 1, interps); AnnotationArgs args = new AnnotationArgs(nodes, currLayer.Intent); //process those nodes currLayer.Layer.ProcessAnnotations(args); //save the configuration id so we know if this layer becomes invalidated. SetConfigId(layers, i); } } } catch (Exception e) { throw new LayerException(currLayer, e); } }
//Some annotations might be updated with an old library and others might be updated with a new one. public static void UpdateInvalidatedLayers(List <LayerWrapper> layers) { //Initialize the intermediate interpretations Dictionary <string, InterpretationFromImage> interps = InitializeInterpretations(layers); string configId = LayerChain.ConfigurationId(layers, -1); LayerWrapper currLayer = null; //For each layer, re-interpret the captured images for its annotations //and let the layer recompute any data for them try { for (int i = 0; i < layers.Count; i++) { currLayer = layers[i]; //Check if the layer is invalidated string layerConfigId = GetPreviousConfigId(currLayer); if (!configId.StartsWith(layerConfigId)) { List <AnnotatedNode> nodes = NodesFromImageAnnotations(layers, i - 1, interps); AnnotationArgs args = new AnnotationArgs(nodes, currLayer.Intent); //process those nodes currLayer.Layer.ProcessAnnotations(args); //save the configuration id so we know if this layer becomes invalidated. SetConfigId(layers, i); } } } catch (Exception e) { throw new LayerException(currLayer, e); } }
public void ProcessAnnotations(AnnotationArgs args) { _runtimeIntent.Clear(); foreach (AnnotatedNode anode in args.AnnotatedNodes) { if (anode.MatchingNode != null) { string path = PathDescriptor.GetPath(anode.MatchingNode, anode.Root); _runtimeIntent.PutData(path, anode.Data); } } }
public void ProcessAnnotations(AnnotationArgs args) { }
public void ProcessAnnotations(AnnotationArgs args) { //To change body of implemented methods use File | Settings | File Templates. }
public void ProcessAnnotations(AnnotationArgs args) { if (_processAnnotationsFunc != null) { try { _annotionArgs.Args = args; _annotionArgs.runtime_storage = new PythonRuntimeStorageWrapper(args.RuntimeStorage); _processAnnotationsFunc(_annotionArgs); } catch (Exception e) { throw PythonScriptHost.Instance.GetFormattedException(e, Name); } } }
public void ProcessAnnotations(AnnotationArgs args) { //This is where we are going to look at the annotation library //to learn from the examples. try { List<Ptype> lib = new List<Ptype>(); bool needsUpdate = ptypeUtil.UpdatePtypes(args.AnnotatedNodes, lib); if(needsUpdate){ shared[SHARED_PTYPES_KEY] = lib; featureTree = FeatureTree.FeatureTree.BuildTree( GetFeatures(lib) ); } } catch (Exception e) { Console.WriteLine (e.StackTrace); } }