Esempio n. 1
0
        public static void Main(string[] args)
        {
            try
            {
                //if (args.Length < 2)
                //{
                //	Console.WriteLine("not enough arguments");
                //	return;
                //}

                WekaInvoke<weka.classifiers.lazy.IBk> wki = new WekaInvoke<weka.classifiers.lazy.IBk>("train.arff");
                DataFilter dtf = new DataFilter(wki.attributes);
                //WekaOutput wko = new WekaOutput(wki.classifications);
                ValueDisplayBars vds = new ValueDisplayBars(wki.classifications);

                Console.WriteLine(wki.attributes.mkstring());
                Console.WriteLine(wki.classifications.mkstring());

                //wki.SetWekaOutputDelegate(wko.GetWekaOutputDelegate());
                wki.SetWekaOutputDelegate(vds.GetWekaOutputDelegate());
                dtf.SetFilterOutputDelegate(wki.GetWekaInputDelegate());

                /*
                PraatInvoke pri = new PraatInvoke(args[0], args[1]);
                PraatOutput pao = new PraatOutput();
                WaveWriter wwr = new WaveWriter();
                PortAudioRecord rec = new PortAudioRecord();
                rec.SetSamplesDelegate(wwr.GetSamplesDelegate());
                wwr.SetPraatDelegate(pri.GetPraatDelegate());
                pri.SetOutputPraatDelegate(pao.GetPraatOutputDelegate());
                rec.audio.Start();
                */

                FaceAPIOutput fao = new FaceAPIOutput();
                FaceAPIWrapper.FaceInvoke fci = new FaceAPIWrapper.FaceInvoke();
                fci.SetHeadPoseDelegate(fao.GetHeadPoseDelegate());
                fci.SetLandmarksDelegate(fao.GetLandmarksDelegate());
                fao.SetDataFilterDelegate(dtf.GetFilterInputDelegate());
                fci.RunThread();

                System.Windows.Forms.Application.Run(vds);
                fci.thread.Abort();
                //System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
                //rec.Stop();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            try
            {
                //if (args.Length < 2)
                //{
                //	Console.WriteLine("not enough arguments");
                //	return;
                //}

                WekaInvoke <weka.classifiers.lazy.IBk> wki = new WekaInvoke <weka.classifiers.lazy.IBk>("train.arff");
                DataFilter dtf = new DataFilter(wki.attributes);
                //WekaOutput wko = new WekaOutput(wki.classifications);
                ValueDisplayBars vds = new ValueDisplayBars(wki.classifications);

                Console.WriteLine(wki.attributes.mkstring());
                Console.WriteLine(wki.classifications.mkstring());

                //wki.SetWekaOutputDelegate(wko.GetWekaOutputDelegate());
                wki.SetWekaOutputDelegate(vds.GetWekaOutputDelegate());
                dtf.SetFilterOutputDelegate(wki.GetWekaInputDelegate());

                /*
                 * PraatInvoke pri = new PraatInvoke(args[0], args[1]);
                 * PraatOutput pao = new PraatOutput();
                 * WaveWriter wwr = new WaveWriter();
                 * PortAudioRecord rec = new PortAudioRecord();
                 * rec.SetSamplesDelegate(wwr.GetSamplesDelegate());
                 * wwr.SetPraatDelegate(pri.GetPraatDelegate());
                 * pri.SetOutputPraatDelegate(pao.GetPraatOutputDelegate());
                 * rec.audio.Start();
                 */

                FaceAPIOutput             fao = new FaceAPIOutput();
                FaceAPIWrapper.FaceInvoke fci = new FaceAPIWrapper.FaceInvoke();
                fci.SetHeadPoseDelegate(fao.GetHeadPoseDelegate());
                fci.SetLandmarksDelegate(fao.GetLandmarksDelegate());
                fao.SetDataFilterDelegate(dtf.GetFilterInputDelegate());
                fci.RunThread();

                System.Windows.Forms.Application.Run(vds);
                fci.thread.Abort();
                //System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
                //rec.Stop();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }