DL_Viewer build up - 1

日 28 7月 2019

DL_Viewer build up

Behinds and Goal

  1. For Kaggle.
    • I have just started its competition and choose the one for image recognition.
    • It may useful to browse besides rules of each competition, as customizable viewer.
  2. Images with labels, and inferences.
    • I will use Pytorch or Tensorflow on python environment for modeling phase and inference phase.
    • After that, this viewer could read those kind of csv/texts, with images to view efficiently.
  3. Inference results.

    • It will be good if it shows evaluation values, which will be defined by competition.
    • By one image / whole image statistics.
  4. Modern view on Windows.

    • It will be good relative to my job requirements, so I choose WPF on C#.
    • I also need to study deplying application on windows, I have been far from it for a long time.
  5. Feature work
    • I'm checking deployment way of onnx model.
      • With C++/OpenCV4.1 or on C++/onnx runtime or so.
      • Later , I may add deployment functions using these on the application.

Day 1 :

Start the solution.

  1. Making WPF application with Visual Studio 2019.
  2. Add functions reading inputs.
  3. Add GUI like agile, though I'm not good for agile, practice.

Show images on dialogue.

  1. Making file list on folder.

    • Add class variable below. cs private string[] files; private int ind_files = 0;//plan to add Prev/Next button to browse images.
    • Add making filelist on constructor. cs using System.IO;//for Directory specifier.

      cs files = Directory.GetFiles(fbd.SelectedPath, "*.JPG").Concat(Directory.GetFiles(fbd.SelectedPath, "*.JPEG")).ToArray(); ind_files = 0; * Finally, I can get file names in files[], using ind_files.

  2. Load image on dialogue.

    • This is first one I choose to show images using WPF.
    • As WPF, the architecture core (Word to be fixed) is to intervene data through image below.
    • Call this function when I wish to update it.

      ```cs private void UpdateImage(int add = 0) { // When not specified the folder. if (files == null) return;

      // index change
      ind_files += add;
      if (ind_files < 0)
      {
          ind_files = files.Length - 1;
      }
      else if (ind_files >= files.Length)
      {
          ind_files = 0;
      }
      
      // load image and update
      var source = new BitmapImage();
      source.BeginInit();
      source.UriSource = new Uri("file://" + files[ind_files]);
      source.EndInit();
      
      // Draw Original
      image.Source = source;
      

      } ```


      Achievement

      First view

Other settings

  • Disable XAML UI debug tool.
    • From Debug menu -> Option.

social