DL_Viewer build up
Behinds and Goal
- 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.
- 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.
-
Inference results.
- It will be good if it shows evaluation values, which will be defined by competition.
- By one image / whole image statistics.
-
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.
- 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.
- I'm checking deployment way of
Day 1 :
Start the solution.
- Making WPF application with
Visual Studio 2019
. - Add functions reading inputs.
- Add GUI like agile, though I'm not good for agile, practice.
Show images on dialogue.
-
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 infiles[]
, usingind_files
.
- Add class variable below.
-
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
Other settings
- Disable XAML UI debug tool.
- From Debug menu -> Option.