-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
58 lines (45 loc) · 1.44 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using ConsoleApplication1.Funcs;
using ConsoleApplication1.Model;
using ConsoleApplication1.Service;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
try
{
var loader = new ImageLoader();
var imagePath = @"..\..\Files\t10k-images.idx3-ubyte";
var labelPath = @"..\..\Files\t10k-labels.idx1-ubyte";
var model = new CallbackModelWrapper(imagePath, labelPath);
Func<CallbackModelWrapper, Task<CallbackModelWrapper>> coreFunc = (x) =>
{
return loader.PopulateImagesAsync(x);
};
Action finallyAction = () => { };
model = GenericCallbacks.ExecuteSafe(coreFunc, model, FinallyFun: finallyAction).Result;
foreach (var image in model.Images)
{
Console.WriteLine(image.ToString());
Console.ReadLine();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.WriteLine("\nEnd\n");
Console.ReadLine();
}
}
}