-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (35 loc) · 1.43 KB
/
Program.cs
File metadata and controls
42 lines (35 loc) · 1.43 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
using ImageClassification.ModelScorer;
using System;
using System.IO;
namespace ImageClassification
{
public class Program
{
static void Main(string[] args)
{
string assetsRelativePath = @"D:\repos2\c#\ImageClassification\assets\";
string assetsPath = GetAbsolutePath(assetsRelativePath);
var tagsTsv = Path.Combine(assetsPath, "inputs", "images", "tags.tsv");
var imagesFolder = Path.Combine(assetsPath, "inputs", "images");
var inceptionPb = Path.Combine(assetsPath, "inputs", "inception", "tensorflow_inception_graph.pb");
var labelsTxt = Path.Combine(assetsPath, "inputs", "inception", "imagenet_comp_graph_label_strings.txt");
try
{
var modelScorer = new TFModelScorer(tagsTsv, imagesFolder, inceptionPb, labelsTxt);
modelScorer.Score();
}
catch (Exception ex)
{
ConsoleHelpers.ConsoleWriteException(ex.ToString());
}
ConsoleHelpers.ConsolePressAnyKey();
}
public static string GetAbsolutePath(string relativePath)
{
FileInfo _dataRoot = new FileInfo(typeof(Program).Assembly.Location);
string assemblyFolderPath = _dataRoot.Directory.FullName;
string fullPath = Path.Combine(assemblyFolderPath, relativePath);
return fullPath;
}
}
}