示例#1
0
 /// <summary>
 ///
 /// </summary>
 public new void Dispose()
 {
     _logcatAdvanced?.Dispose();
     _cmdProcess?.Dispose();
     _formMethods?.Dispose();
     _cmdProcess?.GetProcess?.Dispose();
     GC.SuppressFinalize(this);
 }
示例#2
0
        // STEP 2
        private void MakeImageQueueFileFromFolder_Task()
        {
            String CWD = Path.Combine(Properties.Settings.Default.ProjectDir, "ImageBatch");

            CmdProcess Proc = new CmdProcess(CWD);

            Proc.AddToQueue("dir /s/b *.jpg > ImageQueue.txt");
            Proc.Execute();
            Proc.Dispose();
        }
 /// <summary>
 ///
 /// </summary>
 public new void Dispose()
 {
     _altAdb?.Dispose();
     _lOut?.Dispose();
     //if (GC.SuppressFinalize(this) != null)
     //    return true;
     //else
     //    return false;
     GC.SuppressFinalize(this);
 }
示例#4
0
        private void TagImages_NeverShow_Task(String InputFile)
        {
            String DarknetDir        = Properties.Settings.Default.Darknet_Path;
            String WorkspaceDir      = Properties.Settings.Default.ProjectDir;
            String ResultFileEndPath = Path.Combine(WorkspaceDir, "VideoData", Path.GetFileName(VideoPath) + ".json");

            CmdProcess Proc2 = new CmdProcess(DarknetDir);

            Proc2.AddToQueue("type nul > " + ResultFileEndPath);
            Proc2.AddToQueue(@"darknet.exe detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights -ext_output -dont_show -out " + ResultFileEndPath + " < " + InputFile);
            Proc2.ExecuteAndDispose();
            Proc2.Dispose();
        }
示例#5
0
        private void TagImages_AlwaysShow_Task(List <String> ImageList, String ImageOutputPath = "ImageTag", String DataOutputPath = "ImageData")
        {
            String DarknetDir   = Properties.Settings.Default.Darknet_Path;
            String WorkspaceDir = Properties.Settings.Default.ProjectDir;

            CmdProcess Proc = new CmdProcess(DarknetDir);

            foreach (String str in ImageList)
            {
                // Section to copy over image
                String ImageCopyStartPath = Path.Combine(DarknetDir, "predictions.jpg");
                String ImageCopyEndPath   = Path.Combine(WorkspaceDir, ImageOutputPath, Path.GetFileName(str));
                String ResultFileEndPath  = Path.Combine(WorkspaceDir, DataOutputPath, Path.GetFileName(str) + ".json");

                Proc.AddToQueue(@"darknet.exe detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights -ext_output -out " + ResultFileEndPath + " " + str);
                Proc.QueueCopy(ImageCopyStartPath, ImageCopyEndPath);
            }
            Proc.Execute();
            Proc.Dispose();
        }
示例#6
0
        private void TagImages_NeverShow_Task(List <String> ImageList, String DataOutputPath = "ImageData")
        {
            String DarknetDir        = Properties.Settings.Default.Darknet_Path;
            String WorkspaceDir      = Properties.Settings.Default.ProjectDir;
            String ResultFileEndPath = Path.Combine(WorkspaceDir, DataOutputPath, "_Result.json");
            String ImageListDir      = Path.Combine(Environment.CurrentDirectory, "Resources/ImageList.txt");

            CmdProcess Proc = new CmdProcess(DarknetDir);

            Proc.AddToQueue("type nul > " + ImageListDir);
            Proc.AddToQueue("type nul > " + ResultFileEndPath);
            Proc.ExecuteAndDispose();
            Proc.Dispose();

            // Write the string array to a new file named "WriteLines.txt".
            using (StreamWriter outputFile = new StreamWriter(Path.Combine(Environment.CurrentDirectory, "Resources", "ImageList.txt")))
            {
                foreach (string line in ImageList)
                {
                    outputFile.WriteLine(line);
                }
                outputFile.Close();
            }

            CmdProcess Proc2 = new CmdProcess(DarknetDir);

            Proc2.AddToQueue(@"darknet.exe detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights -ext_output -dont_show -out " + ResultFileEndPath + " < " + ImageListDir);
            Proc2.ExecuteAndDispose();
            Proc2.Dispose();

            // String ScriptPath = Path.Combine(Environment.CurrentDirectory, "Scripts/Darknet_ImageBatch.ps1");
            // Powershell_Custom cust = new Powershell_Custom(Properties.Settings.Default.Darknet_Path, ScriptPath);
            // cust.AddParameter("Images", ImageList);
            // cust.AddParameter("ImageListLoc", ImageListDir);
            // cust.AddParameter("OutputDataDir", ResultFileEndPath);
            // cust.Execute();
        }
示例#7
0
 public new void Dispose()
 {
     _altAdb?.Dispose();
     _lOut?.Dispose();
     GC.SuppressFinalize(this);
 }