public override void run(Sketch.Sketch original, string filename)
        {
            _numTests++;

            foreach (RecognitionPipeline pipeline in _pipelines)
            {
                Sketch.Sketch sketch = original.Clone();
                sketch.RemoveLabelsAndGroups();
                pipeline.process(sketch);

                Utils.SketchComparer comparer = new Utils.SketchComparer(original, sketch);

                double cls = comparer.ClassificationQuality * 100;
                double grp = comparer.GroupingQuality * 100;
                double rec = comparer.RecognitionQuality * 100;

                Console.WriteLine("--------- Results ---------");
                Console.WriteLine("    Classification: " + cls + "%");
                Console.WriteLine("    Grouping:       " + grp + "%");
                Console.WriteLine("    Recognition:    " + rec + "%");

                _tables[pipeline].addResult(new string[] {
                    filename,
                    "" + cls,
                    "" + grp,
                    "" + rec
                });

                _classificationConfusion[pipeline].AddResults(comparer.ClassificationConfusion);
                _recognitionConfusion[pipeline].AddResults(comparer.RecognitionConfusion);

                _cls[pipeline] += cls;
                _grp[pipeline] += grp;
                _rec[pipeline] += rec;
            }
        }
Exemple #2
0
        public override void run(Sketch.Sketch original, string filename)
        {
            _numTests++;

            foreach (RecognitionPipeline pipeline in _pipelines)
            {
                Sketch.Sketch sketch = original.Clone();
                sketch.RemoveLabelsAndGroups();
                pipeline.process(sketch);

                string sketchFilename = "sketch-" + _numTests + " pipeline-" + pipelineId(pipeline) + ".xml";
                Console.WriteLine("Saving sketch to " + sketchFilename);
                ConverterXML.SaveToXML saver = new ConverterXML.SaveToXML(new Sketch.Project(sketch));
                saver.WriteXML(sketchFilename);

                Utils.SketchComparer comparer = new Utils.SketchComparer(original, sketch);

                double cls = comparer.ClassificationQuality * 100;

                /* This grouping stat is the
                 *  (# groups found correctly / # correct groups)
                 *  Where # correct groups is the number of groups in
                 *  the correctly recognized sketch.
                 */
                double grp = comparer.GroupingQuality * 100;

                /*This recognition stat is the
                 * (# groups recognized correctly / # groups found correctly)
                 */
                double rec = comparer.RecognitionQuality * 100;

                /*This is the recognition stat that we really care about,
                 * because it portrays the recognition rate out of all the
                 * groups in the sketch
                 */
                double realRec = comparer.RecognitionQuality * comparer.GroupingQuality * 100;
                double srec    = comparer.SubstrokeRecognitionQuality * 100;

                Console.WriteLine("--------- Results ---------");
                Console.WriteLine("    Classification: " + cls + "%");
                Console.WriteLine("    Grouping:       " + grp + "%");
                Console.WriteLine("    Recognition out of correctly grouped groups:    " + rec + "%");
                Console.WriteLine("    Recognition out of all the groups:    " + realRec + "%");
                Console.WriteLine("    Substroke Rec.: " + srec + "%");

                _tables[pipeline].addResult(new string[] {
                    filename,
                    "" + cls,
                    "" + grp,
                    "" + rec,
                    "" + realRec,
                    "" + srec
                });

                _classificationConfusion[pipeline].AddResults(comparer.ClassificationConfusion);
                _recognitionConfusion[pipeline].AddResults(comparer.RecognitionConfusion);

                _cls[pipeline]     += cls;
                _grp[pipeline]     += grp;
                _rec[pipeline]     += rec;
                _realRec[pipeline] += realRec;
                _srec[pipeline]    += srec;
            }
        }