Skip to content

Commit 50aacfa

Browse files
committed
Shuffle samples
1 parent 85562d3 commit 50aacfa

File tree

11 files changed

+86
-6
lines changed

11 files changed

+86
-6
lines changed

ExampleInceptionInference/ExampleInceptionInference.csproj renamed to Examples/ExampleInceptionInference/ExampleInceptionInference.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<Compile Include="Properties\AssemblyInfo.cs" />
4141
</ItemGroup>
4242
<ItemGroup>
43-
<ProjectReference Include="..\TensorFlowSharp\TensorFlowSharp.csproj">
43+
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj">
4444
<Project>{0264C321-34F4-46AF-819E-168D1E597232}</Project>
4545
<Name>TensorFlowSharp</Name>
4646
</ProjectReference>
@@ -49,4 +49,4 @@
4949
<None Include="packages.config" />
5050
</ItemGroup>
5151
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
52-
</Project>
52+
</Project>
File renamed without changes.

ExampleInceptionInference/Properties/AssemblyInfo.cs renamed to Examples/ExampleInceptionInference/Properties/AssemblyInfo.cs

File renamed without changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
An example for using the TensorFlow C# API for image recognition
2+
using a pre-trained inception model (http://arxiv.org/abs/1512.00567).
3+
4+
Sample usage:
5+
6+
```
7+
mono ExampleInceptionInference.exe [--dir=/tmp/modeldir] imagefile...
8+
9+
The pre-trained model takes input in the form of a 4-dimensional
10+
tensor with shape [ BATCH_SIZE, IMAGE_HEIGHT, IMAGE_WIDTH, 3 ],
11+
where:
12+
13+
- BATCH_SIZE allows for inference of multiple images in one pass through the graph
14+
- IMAGE_HEIGHT is the height of the images on which the model was trained
15+
- IMAGE_WIDTH is the width of the images on which the model was trained
16+
- 3 is the (R, G, B) values of the pixel colors represented as a float.
17+
18+
And produces as output a vector with shape [ NUM_LABELS ].
19+
output[i] is the probability that the input image was recognized as
20+
having the i-th label.
21+
22+
A separate file contains a list of string labels corresponding to the
23+
integer indices of the output.
24+
25+
This example:
26+
- Loads the serialized representation of the pre-trained model into a Graph
27+
- Creates a Session to execute operations on the Graph
28+
- Converts an image file to a Tensor to provide as input to a Session run
29+
- Executes the Session and prints out the label with the highest probability
30+
31+
To convert an image file to a Tensor suitable for input to the Inception model,
32+
this example:
33+
- Constructs another TensorFlow graph to normalize the image into a
34+
form suitable for the model (for example, resizing the image)
35+
- Creates an executes a Session to obtain a Tensor in this normalized form.
File renamed without changes.
File renamed without changes.

FExampleInceptionInference/FExampleInceptionInference.fsproj renamed to Examples/FExampleInceptionInference/FSharpExampleInceptionInference.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<Compile Include="Program.fs" />
4949
</ItemGroup>
5050
<ItemGroup>
51-
<ProjectReference Include="..\TensorFlowSharp\TensorFlowSharp.csproj">
51+
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj">
5252
<Project>{0264C321-34F4-46AF-819E-168D1E597232}</Project>
5353
<Name>TensorFlowSharp</Name>
5454
</ProjectReference>
@@ -66,4 +66,4 @@
6666
</Properties>
6767
</MonoDevelop>
6868
</ProjectExtensions>
69-
</Project>
69+
</Project>
File renamed without changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
An example for using the TensorFlow F# API for image recognition
2+
using a pre-trained inception model (http://arxiv.org/abs/1512.00567).
3+
4+
Sample usage:
5+
6+
```
7+
mono ExampleInceptionInference.exe [--dir=/tmp/modeldir] imagefile...
8+
9+
The pre-trained model takes input in the form of a 4-dimensional
10+
tensor with shape [ BATCH_SIZE, IMAGE_HEIGHT, IMAGE_WIDTH, 3 ],
11+
where:
12+
13+
- BATCH_SIZE allows for inference of multiple images in one pass through the graph
14+
- IMAGE_HEIGHT is the height of the images on which the model was trained
15+
- IMAGE_WIDTH is the width of the images on which the model was trained
16+
- 3 is the (R, G, B) values of the pixel colors represented as a float.
17+
18+
And produces as output a vector with shape [ NUM_LABELS ].
19+
output[i] is the probability that the input image was recognized as
20+
having the i-th label.
21+
22+
A separate file contains a list of string labels corresponding to the
23+
integer indices of the output.
24+
25+
This example:
26+
- Loads the serialized representation of the pre-trained model into a Graph
27+
- Creates a Session to execute operations on the Graph
28+
- Converts an image file to a Tensor to provide as input to a Session run
29+
- Executes the Session and prints out the label with the highest probability
30+
31+
To convert an image file to a Tensor suitable for input to the Inception model,
32+
this example:
33+
- Constructs another TensorFlow graph to normalize the image into a
34+
form suitable for the model (for example, resizing the image)
35+
- Creates an executes a Session to obtain a Tensor in this normalized form.

TensorFlowSharp.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpGenerator", "OpGenerator\
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Learn", "Learn\Learn.csproj", "{20567EDE-7C20-4734-B489-C6D303843105}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleInceptionInference", "ExampleInceptionInference\ExampleInceptionInference.csproj", "{069A6736-7711-4805-8660-A267E713BC54}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleInceptionInference", "Examples\ExampleInceptionInference\ExampleInceptionInference.csproj", "{069A6736-7711-4805-8660-A267E713BC54}"
1313
EndProject
14-
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "FExampleInceptionInference", "FExampleInceptionInference\FExampleInceptionInference.fsproj", "{03FB7F3A-6D24-4033-9B04-69AD8A198CCF}"
14+
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "FSharpExampleInceptionInference", "Examples\FExampleInceptionInference\FSharpExampleInceptionInference.fsproj", "{03FB7F3A-6D24-4033-9B04-69AD8A198CCF}"
15+
EndProject
16+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{674EC1D7-9649-462E-A7A8-93D0DE84FE64}"
1517
EndProject
1618
Global
1719
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -44,4 +46,8 @@ Global
4446
{03FB7F3A-6D24-4033-9B04-69AD8A198CCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
4547
{03FB7F3A-6D24-4033-9B04-69AD8A198CCF}.Release|Any CPU.Build.0 = Release|Any CPU
4648
EndGlobalSection
49+
GlobalSection(NestedProjects) = preSolution
50+
{069A6736-7711-4805-8660-A267E713BC54} = {674EC1D7-9649-462E-A7A8-93D0DE84FE64}
51+
{03FB7F3A-6D24-4033-9B04-69AD8A198CCF} = {674EC1D7-9649-462E-A7A8-93D0DE84FE64}
52+
EndGlobalSection
4753
EndGlobal

0 commit comments

Comments
 (0)