Program.cs
2.6 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace eyemLib_Sharp
{
class Program
{
static void Main(string[] args)
{
DirectoryInfo di = new DirectoryInfo("D:\\日志\\");
if (!di.Exists)
{
di.Create();
}
//初始化
EyemLib.Init();
string[] fileNames = Directory.GetFiles(@"D:\批量测试图像\", "*.*", SearchOption.AllDirectories);
//int iter = 0;
//for (int i = 0; i < 10000; i++)
//{
// ParallelOptions po = new ParallelOptions();
// po.MaxDegreeOfParallelism = 2;
// Parallel.ForEach(fileNames, po, fn =>
// {
// EyemLib.eyemReadImageTool(fn);
// });
// iter++;
// if (iter > 50)
// {
// iter = 0;
// Console.Clear();
// }
// Thread.Sleep(10);
//}
//for (int i = 0; i < 5000; i++)
//{
foreach (var item in fileNames)
{
EyemLib.eyemReadImageTool(item);
}
// iter++;
// if (iter > 200)
// {
// iter = 0;
// Console.Clear();
// }
//}
//for (int i = 0; i < 1; i++)
//{
// EyemLib.eyemTestVideoCapture("D:\\插件完成检测\\视频\\ios3.mov");
//}
//IntPtr hModelID;
//EyemLib.eyemInitModelE(out hModelID);
//int sum = 0;
//for (int i = 0; i < 5000; i++)
//{
// //for (int j = 0; j < fileNames.Length; j++)
// //{
// // EyemLib.eyemReadImageToolE(fileNames[j], hModelID);
// //}
// sum++;
// //并行测试
// ParallelOptions po = new ParallelOptions();
// po.MaxDegreeOfParallelism = 3;
// Parallel.ForEach(fileNames, po, fn =>
// {
// EyemLib.eyemReadImageToolE(fn, hModelID);
// });
// if (sum > 50)
// {
// sum = 0;
// Console.Clear();
// }
//}
//EyemLib.eyemReleaseModelE(ref hModelID);
EyemLib.Free();
Console.Write("请按任意键继续。。。");
Console.ReadKey();
}
}
}