├── .gitignore
├── CODE_OF_CONDUCT.md
├── LICENSE
├── OnnxRuntime.ResNet.Template.csproj
├── OnnxRuntime.ResNet.Template.sln
├── Program.cs
├── README.md
├── SECURITY.md
├── SUPPORT.md
├── data
└── dog.jpeg
├── model
└── resnet50v2.onnx
└── utils
├── ImageHelper.cs
├── LabelMap.cs
├── ModelHelper.cs
└── Prediction.cs
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | *.pubxml
178 | *.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # NuGet Symbol Packages
188 | *.snupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 | *.appxbundle
214 | *.appxupload
215 |
216 | # Visual Studio cache files
217 | # files ending in .cache can be ignored
218 | *.[Cc]ache
219 | # but keep track of directories ending in .cache
220 | !?*.[Cc]ache/
221 |
222 | # Others
223 | ClientBin/
224 | ~$*
225 | *~
226 | *.dbmdl
227 | *.dbproj.schemaview
228 | *.jfm
229 | *.pfx
230 | *.publishsettings
231 | orleans.codegen.cs
232 |
233 | # Including strong name files can present a security risk
234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
235 | #*.snk
236 |
237 | # Since there are multiple workflows, uncomment next line to ignore bower_components
238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
239 | #bower_components/
240 |
241 | # RIA/Silverlight projects
242 | Generated_Code/
243 |
244 | # Backup & report files from converting an old project file
245 | # to a newer Visual Studio version. Backup files are not needed,
246 | # because we have git ;-)
247 | _UpgradeReport_Files/
248 | Backup*/
249 | UpgradeLog*.XML
250 | UpgradeLog*.htm
251 | ServiceFabricBackup/
252 | *.rptproj.bak
253 |
254 | # SQL Server files
255 | *.mdf
256 | *.ldf
257 | *.ndf
258 |
259 | # Business Intelligence projects
260 | *.rdl.data
261 | *.bim.layout
262 | *.bim_*.settings
263 | *.rptproj.rsuser
264 | *- [Bb]ackup.rdl
265 | *- [Bb]ackup ([0-9]).rdl
266 | *- [Bb]ackup ([0-9][0-9]).rdl
267 |
268 | # Microsoft Fakes
269 | FakesAssemblies/
270 |
271 | # GhostDoc plugin setting file
272 | *.GhostDoc.xml
273 |
274 | # Node.js Tools for Visual Studio
275 | .ntvs_analysis.dat
276 | node_modules/
277 |
278 | # Visual Studio 6 build log
279 | *.plg
280 |
281 | # Visual Studio 6 workspace options file
282 | *.opt
283 |
284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
285 | *.vbw
286 |
287 | # Visual Studio LightSwitch build output
288 | **/*.HTMLClient/GeneratedArtifacts
289 | **/*.DesktopClient/GeneratedArtifacts
290 | **/*.DesktopClient/ModelManifest.xml
291 | **/*.Server/GeneratedArtifacts
292 | **/*.Server/ModelManifest.xml
293 | _Pvt_Extensions
294 |
295 | # Paket dependency manager
296 | .paket/paket.exe
297 | paket-files/
298 |
299 | # FAKE - F# Make
300 | .fake/
301 |
302 | # CodeRush personal settings
303 | .cr/personal
304 |
305 | # Python Tools for Visual Studio (PTVS)
306 | __pycache__/
307 | *.pyc
308 |
309 | # Cake - Uncomment if you are using it
310 | # tools/**
311 | # !tools/packages.config
312 |
313 | # Tabs Studio
314 | *.tss
315 |
316 | # Telerik's JustMock configuration file
317 | *.jmconfig
318 |
319 | # BizTalk build output
320 | *.btp.cs
321 | *.btm.cs
322 | *.odx.cs
323 | *.xsd.cs
324 |
325 | # OpenCover UI analysis results
326 | OpenCover/
327 |
328 | # Azure Stream Analytics local run output
329 | ASALocalRun/
330 |
331 | # MSBuild Binary and Structured Log
332 | *.binlog
333 |
334 | # NVidia Nsight GPU debugger configuration file
335 | *.nvuser
336 |
337 | # MFractors (Xamarin productivity tool) working folder
338 | .mfractor/
339 |
340 | # Local History for Visual Studio
341 | .localhistory/
342 |
343 | # BeatPulse healthcheck temp database
344 | healthchecksdb
345 |
346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
347 | MigrationBackup/
348 |
349 | # Ionide (cross platform F# VS Code tools) working folder
350 | .ionide/
351 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/OnnxRuntime.ResNet.Template.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp3.1
6 | 8.0
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/OnnxRuntime.ResNet.Template.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.810.9
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OnnxRuntime.ResNet.Template", "OnnxRuntime.ResNet.Template.csproj", "{6D2E6920-691F-4CDB-970F-324D8743BF8A}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {6D2E6920-691F-4CDB-970F-324D8743BF8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {6D2E6920-691F-4CDB-970F-324D8743BF8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {6D2E6920-691F-4CDB-970F-324D8743BF8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {6D2E6920-691F-4CDB-970F-324D8743BF8A}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {B0A0513C-D336-4B4A-B22B-13429F23CA44}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.ML.OnnxRuntime;
2 | using OnnxRuntime.ResNet.Template.utils;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 |
7 | namespace OnnxRuntime.ResNet.Template
8 | {
9 | class Program
10 | {
11 | public static void Main(string[] args)
12 | {
13 | // Read paths
14 | string modelFilePath = @"C:\code\onnxruntime-templates\onnxruntime-csharp-cv-template\model\resnet50v2.onnx";
15 | string imageFilePath = @"C:\code\onnxruntime-templates\onnxruntime-csharp-cv-template\data\dog.jpeg";
16 |
17 | var input = ImageHelper.GetImageTensorFromPath(imageFilePath);
18 | var top10 = ModelHelper.GetPredictions(input, modelFilePath);
19 |
20 | // Print results to console
21 | Console.WriteLine("Top 10 predictions for ResNet50 v2...");
22 | Console.WriteLine("--------------------------------------------------------------");
23 | foreach (var t in top10)
24 | {
25 | Console.WriteLine($"Label: {t.Label}, Confidence: {t.Confidence}");
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## Contributing
3 |
4 | This project welcomes contributions and suggestions. Most contributions require you to agree to a
5 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
6 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
7 |
8 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide
9 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
10 | provided by the bot. You will only need to do this once across all repos using our CLA.
11 |
12 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
13 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
14 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
15 |
16 | ## Trademarks
17 |
18 | This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
19 | trademarks or logos is subject to and must follow
20 | [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
21 | Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
22 | Any use of third-party trademarks or logos are subject to those third-party's policies.
23 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40 |
41 |
--------------------------------------------------------------------------------
/SUPPORT.md:
--------------------------------------------------------------------------------
1 | # TODO: The maintainer of this repo has not yet edited this file
2 |
3 | **REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
4 |
5 | - **No CSS support:** Fill out this template with information about how to file issues and get help.
6 | - **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport).
7 | - **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide.
8 |
9 | *Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
10 |
11 | # Support
12 |
13 | ## How to file issues and get help
14 |
15 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing
16 | issues before filing new issues to avoid duplicates. For new issues, file your bug or
17 | feature request as a new Issue.
18 |
19 | For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
20 | FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
21 | CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
22 |
23 | ## Microsoft Support Policy
24 |
25 | Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
26 |
--------------------------------------------------------------------------------
/data/dog.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/onnxruntime-csharp-cv-template/6749cd4be039177301effb1e3958cf9814c70142/data/dog.jpeg
--------------------------------------------------------------------------------
/model/resnet50v2.onnx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/onnxruntime-csharp-cv-template/6749cd4be039177301effb1e3958cf9814c70142/model/resnet50v2.onnx
--------------------------------------------------------------------------------
/utils/ImageHelper.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.ML.OnnxRuntime.Tensors;
2 | using SixLabors.ImageSharp;
3 | using SixLabors.ImageSharp.PixelFormats;
4 | using SixLabors.ImageSharp.Processing;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Text;
8 |
9 | namespace OnnxRuntime.ResNet.Template
10 | {
11 | public static class ImageHelper
12 | {
13 | public static Tensor GetImageTensorFromPath(string imageFilePath, int imgWidth = 224, int imgHeight=224)
14 | {
15 | // Read image
16 | using Image image = Image.Load(imageFilePath);
17 |
18 | // Resize image
19 | image.Mutate(x =>
20 | {
21 | x.Resize(new ResizeOptions
22 | {
23 | Size = new Size(imgWidth, imgHeight),
24 | Mode = ResizeMode.Crop
25 | });
26 | });
27 |
28 | // Preprocess image
29 | Tensor input = new DenseTensor(new[] { 1, 3, 224, 224 });
30 | var mean = new[] { 0.485f, 0.456f, 0.406f };
31 | var stddev = new[] { 0.229f, 0.224f, 0.225f };
32 | for (int y = 0; y < image.Height; y++)
33 | {
34 | Span pixelSpan = image.GetPixelRowSpan(y);
35 | for (int x = 0; x < image.Width; x++)
36 | {
37 | input[0, 0, y, x] = ((pixelSpan[x].R / 255f) - mean[0]) / stddev[0];
38 | input[0, 1, y, x] = ((pixelSpan[x].G / 255f) - mean[1]) / stddev[1];
39 | input[0, 2, y, x] = ((pixelSpan[x].B / 255f) - mean[2]) / stddev[2];
40 | }
41 | }
42 |
43 | return input;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/utils/LabelMap.cs:
--------------------------------------------------------------------------------
1 | namespace OnnxRuntime.ResNet.Template
2 | {
3 | public class LabelMap
4 | {
5 | public static readonly string[] Labels = new[] {"tench",
6 | "goldfish",
7 | "great white shark",
8 | "tiger shark",
9 | "hammerhead shark",
10 | "electric ray",
11 | "stingray",
12 | "cock",
13 | "hen",
14 | "ostrich",
15 | "brambling",
16 | "goldfinch",
17 | "house finch",
18 | "junco",
19 | "indigo bunting",
20 | "American robin",
21 | "bulbul",
22 | "jay",
23 | "magpie",
24 | "chickadee",
25 | "American dipper",
26 | "kite",
27 | "bald eagle",
28 | "vulture",
29 | "great grey owl",
30 | "fire salamander",
31 | "smooth newt",
32 | "newt",
33 | "spotted salamander",
34 | "axolotl",
35 | "American bullfrog",
36 | "tree frog",
37 | "tailed frog",
38 | "loggerhead sea turtle",
39 | "leatherback sea turtle",
40 | "mud turtle",
41 | "terrapin",
42 | "box turtle",
43 | "banded gecko",
44 | "green iguana",
45 | "Carolina anole",
46 | "desert grassland whiptail lizard",
47 | "agama",
48 | "frilled-necked lizard",
49 | "alligator lizard",
50 | "Gila monster",
51 | "European green lizard",
52 | "chameleon",
53 | "Komodo dragon",
54 | "Nile crocodile",
55 | "American alligator",
56 | "triceratops",
57 | "worm snake",
58 | "ring-necked snake",
59 | "eastern hog-nosed snake",
60 | "smooth green snake",
61 | "kingsnake",
62 | "garter snake",
63 | "water snake",
64 | "vine snake",
65 | "night snake",
66 | "boa constrictor",
67 | "African rock python",
68 | "Indian cobra",
69 | "green mamba",
70 | "sea snake",
71 | "Saharan horned viper",
72 | "eastern diamondback rattlesnake",
73 | "sidewinder",
74 | "trilobite",
75 | "harvestman",
76 | "scorpion",
77 | "yellow garden spider",
78 | "barn spider",
79 | "European garden spider",
80 | "southern black widow",
81 | "tarantula",
82 | "wolf spider",
83 | "tick",
84 | "centipede",
85 | "black grouse",
86 | "ptarmigan",
87 | "ruffed grouse",
88 | "prairie grouse",
89 | "peacock",
90 | "quail",
91 | "partridge",
92 | "grey parrot",
93 | "macaw",
94 | "sulphur-crested cockatoo",
95 | "lorikeet",
96 | "coucal",
97 | "bee eater",
98 | "hornbill",
99 | "hummingbird",
100 | "jacamar",
101 | "toucan",
102 | "duck",
103 | "red-breasted merganser",
104 | "goose",
105 | "black swan",
106 | "tusker",
107 | "echidna",
108 | "platypus",
109 | "wallaby",
110 | "koala",
111 | "wombat",
112 | "jellyfish",
113 | "sea anemone",
114 | "brain coral",
115 | "flatworm",
116 | "nematode",
117 | "conch",
118 | "snail",
119 | "slug",
120 | "sea slug",
121 | "chiton",
122 | "chambered nautilus",
123 | "Dungeness crab",
124 | "rock crab",
125 | "fiddler crab",
126 | "red king crab",
127 | "American lobster",
128 | "spiny lobster",
129 | "crayfish",
130 | "hermit crab",
131 | "isopod",
132 | "white stork",
133 | "black stork",
134 | "spoonbill",
135 | "flamingo",
136 | "little blue heron",
137 | "great egret",
138 | "bittern",
139 | "crane (bird)",
140 | "limpkin",
141 | "common gallinule",
142 | "American coot",
143 | "bustard",
144 | "ruddy turnstone",
145 | "dunlin",
146 | "common redshank",
147 | "dowitcher",
148 | "oystercatcher",
149 | "pelican",
150 | "king penguin",
151 | "albatross",
152 | "grey whale",
153 | "killer whale",
154 | "dugong",
155 | "sea lion",
156 | "Chihuahua",
157 | "Japanese Chin",
158 | "Maltese",
159 | "Pekingese",
160 | "Shih Tzu",
161 | "King Charles Spaniel",
162 | "Papillon",
163 | "toy terrier",
164 | "Rhodesian Ridgeback",
165 | "Afghan Hound",
166 | "Basset Hound",
167 | "Beagle",
168 | "Bloodhound",
169 | "Bluetick Coonhound",
170 | "Black and Tan Coonhound",
171 | "Treeing Walker Coonhound",
172 | "English foxhound",
173 | "Redbone Coonhound",
174 | "borzoi",
175 | "Irish Wolfhound",
176 | "Italian Greyhound",
177 | "Whippet",
178 | "Ibizan Hound",
179 | "Norwegian Elkhound",
180 | "Otterhound",
181 | "Saluki",
182 | "Scottish Deerhound",
183 | "Weimaraner",
184 | "Staffordshire Bull Terrier",
185 | "American Staffordshire Terrier",
186 | "Bedlington Terrier",
187 | "Border Terrier",
188 | "Kerry Blue Terrier",
189 | "Irish Terrier",
190 | "Norfolk Terrier",
191 | "Norwich Terrier",
192 | "Yorkshire Terrier",
193 | "Wire Fox Terrier",
194 | "Lakeland Terrier",
195 | "Sealyham Terrier",
196 | "Airedale Terrier",
197 | "Cairn Terrier",
198 | "Australian Terrier",
199 | "Dandie Dinmont Terrier",
200 | "Boston Terrier",
201 | "Miniature Schnauzer",
202 | "Giant Schnauzer",
203 | "Standard Schnauzer",
204 | "Scottish Terrier",
205 | "Tibetan Terrier",
206 | "Australian Silky Terrier",
207 | "Soft-coated Wheaten Terrier",
208 | "West Highland White Terrier",
209 | "Lhasa Apso",
210 | "Flat-Coated Retriever",
211 | "Curly-coated Retriever",
212 | "Golden Retriever",
213 | "Labrador Retriever",
214 | "Chesapeake Bay Retriever",
215 | "German Shorthaired Pointer",
216 | "Vizsla",
217 | "English Setter",
218 | "Irish Setter",
219 | "Gordon Setter",
220 | "Brittany",
221 | "Clumber Spaniel",
222 | "English Springer Spaniel",
223 | "Welsh Springer Spaniel",
224 | "Cocker Spaniels",
225 | "Sussex Spaniel",
226 | "Irish Water Spaniel",
227 | "Kuvasz",
228 | "Schipperke",
229 | "Groenendael",
230 | "Malinois",
231 | "Briard",
232 | "Australian Kelpie",
233 | "Komondor",
234 | "Old English Sheepdog",
235 | "Shetland Sheepdog",
236 | "collie",
237 | "Border Collie",
238 | "Bouvier des Flandres",
239 | "Rottweiler",
240 | "German Shepherd Dog",
241 | "Dobermann",
242 | "Miniature Pinscher",
243 | "Greater Swiss Mountain Dog",
244 | "Bernese Mountain Dog",
245 | "Appenzeller Sennenhund",
246 | "Entlebucher Sennenhund",
247 | "Boxer",
248 | "Bullmastiff",
249 | "Tibetan Mastiff",
250 | "French Bulldog",
251 | "Great Dane",
252 | "St. Bernard",
253 | "husky",
254 | "Alaskan Malamute",
255 | "Siberian Husky",
256 | "Dalmatian",
257 | "Affenpinscher",
258 | "Basenji",
259 | "pug",
260 | "Leonberger",
261 | "Newfoundland",
262 | "Pyrenean Mountain Dog",
263 | "Samoyed",
264 | "Pomeranian",
265 | "Chow Chow",
266 | "Keeshond",
267 | "Griffon Bruxellois",
268 | "Pembroke Welsh Corgi",
269 | "Cardigan Welsh Corgi",
270 | "Toy Poodle",
271 | "Miniature Poodle",
272 | "Standard Poodle",
273 | "Mexican hairless dog",
274 | "grey wolf",
275 | "Alaskan tundra wolf",
276 | "red wolf",
277 | "coyote",
278 | "dingo",
279 | "dhole",
280 | "African wild dog",
281 | "hyena",
282 | "red fox",
283 | "kit fox",
284 | "Arctic fox",
285 | "grey fox",
286 | "tabby cat",
287 | "tiger cat",
288 | "Persian cat",
289 | "Siamese cat",
290 | "Egyptian Mau",
291 | "cougar",
292 | "lynx",
293 | "leopard",
294 | "snow leopard",
295 | "jaguar",
296 | "lion",
297 | "tiger",
298 | "cheetah",
299 | "brown bear",
300 | "American black bear",
301 | "polar bear",
302 | "sloth bear",
303 | "mongoose",
304 | "meerkat",
305 | "tiger beetle",
306 | "ladybug",
307 | "ground beetle",
308 | "longhorn beetle",
309 | "leaf beetle",
310 | "dung beetle",
311 | "rhinoceros beetle",
312 | "weevil",
313 | "fly",
314 | "bee",
315 | "ant",
316 | "grasshopper",
317 | "cricket",
318 | "stick insect",
319 | "cockroach",
320 | "mantis",
321 | "cicada",
322 | "leafhopper",
323 | "lacewing",
324 | "dragonfly",
325 | "damselfly",
326 | "red admiral",
327 | "ringlet",
328 | "monarch butterfly",
329 | "small white",
330 | "sulphur butterfly",
331 | "gossamer-winged butterfly",
332 | "starfish",
333 | "sea urchin",
334 | "sea cucumber",
335 | "cottontail rabbit",
336 | "hare",
337 | "Angora rabbit",
338 | "hamster",
339 | "porcupine",
340 | "fox squirrel",
341 | "marmot",
342 | "beaver",
343 | "guinea pig",
344 | "common sorrel",
345 | "zebra",
346 | "pig",
347 | "wild boar",
348 | "warthog",
349 | "hippopotamus",
350 | "ox",
351 | "water buffalo",
352 | "bison",
353 | "ram",
354 | "bighorn sheep",
355 | "Alpine ibex",
356 | "hartebeest",
357 | "impala",
358 | "gazelle",
359 | "dromedary",
360 | "llama",
361 | "weasel",
362 | "mink",
363 | "European polecat",
364 | "black-footed ferret",
365 | "otter",
366 | "skunk",
367 | "badger",
368 | "armadillo",
369 | "three-toed sloth",
370 | "orangutan",
371 | "gorilla",
372 | "chimpanzee",
373 | "gibbon",
374 | "siamang",
375 | "guenon",
376 | "patas monkey",
377 | "baboon",
378 | "macaque",
379 | "langur",
380 | "black-and-white colobus",
381 | "proboscis monkey",
382 | "marmoset",
383 | "white-headed capuchin",
384 | "howler monkey",
385 | "titi",
386 | "Geoffroy's spider monkey",
387 | "common squirrel monkey",
388 | "ring-tailed lemur",
389 | "indri",
390 | "Asian elephant",
391 | "African bush elephant",
392 | "red panda",
393 | "giant panda",
394 | "snoek",
395 | "eel",
396 | "coho salmon",
397 | "rock beauty",
398 | "clownfish",
399 | "sturgeon",
400 | "garfish",
401 | "lionfish",
402 | "pufferfish",
403 | "abacus",
404 | "abaya",
405 | "academic gown",
406 | "accordion",
407 | "acoustic guitar",
408 | "aircraft carrier",
409 | "airliner",
410 | "airship",
411 | "altar",
412 | "ambulance",
413 | "amphibious vehicle",
414 | "analog clock",
415 | "apiary",
416 | "apron",
417 | "waste container",
418 | "assault rifle",
419 | "backpack",
420 | "bakery",
421 | "balance beam",
422 | "balloon",
423 | "ballpoint pen",
424 | "Band-Aid",
425 | "banjo",
426 | "baluster",
427 | "barbell",
428 | "barber chair",
429 | "barbershop",
430 | "barn",
431 | "barometer",
432 | "barrel",
433 | "wheelbarrow",
434 | "baseball",
435 | "basketball",
436 | "bassinet",
437 | "bassoon",
438 | "swimming cap",
439 | "bath towel",
440 | "bathtub",
441 | "station wagon",
442 | "lighthouse",
443 | "beaker",
444 | "military cap",
445 | "beer bottle",
446 | "beer glass",
447 | "bell-cot",
448 | "bib",
449 | "tandem bicycle",
450 | "bikini",
451 | "ring binder",
452 | "binoculars",
453 | "birdhouse",
454 | "boathouse",
455 | "bobsleigh",
456 | "bolo tie",
457 | "poke bonnet",
458 | "bookcase",
459 | "bookstore",
460 | "bottle cap",
461 | "bow",
462 | "bow tie",
463 | "brass",
464 | "bra",
465 | "breakwater",
466 | "breastplate",
467 | "broom",
468 | "bucket",
469 | "buckle",
470 | "bulletproof vest",
471 | "high-speed train",
472 | "butcher shop",
473 | "taxicab",
474 | "cauldron",
475 | "candle",
476 | "cannon",
477 | "canoe",
478 | "can opener",
479 | "cardigan",
480 | "car mirror",
481 | "carousel",
482 | "tool kit",
483 | "carton",
484 | "car wheel",
485 | "automated teller machine",
486 | "cassette",
487 | "cassette player",
488 | "castle",
489 | "catamaran",
490 | "CD player",
491 | "cello",
492 | "mobile phone",
493 | "chain",
494 | "chain-link fence",
495 | "chain mail",
496 | "chainsaw",
497 | "chest",
498 | "chiffonier",
499 | "chime",
500 | "china cabinet",
501 | "Christmas stocking",
502 | "church",
503 | "movie theater",
504 | "cleaver",
505 | "cliff dwelling",
506 | "cloak",
507 | "clogs",
508 | "cocktail shaker",
509 | "coffee mug",
510 | "coffeemaker",
511 | "coil",
512 | "combination lock",
513 | "computer keyboard",
514 | "confectionery store",
515 | "container ship",
516 | "convertible",
517 | "corkscrew",
518 | "cornet",
519 | "cowboy boot",
520 | "cowboy hat",
521 | "cradle",
522 | "crane (machine)",
523 | "crash helmet",
524 | "crate",
525 | "infant bed",
526 | "Crock Pot",
527 | "croquet ball",
528 | "crutch",
529 | "cuirass",
530 | "dam",
531 | "desk",
532 | "desktop computer",
533 | "rotary dial telephone",
534 | "diaper",
535 | "digital clock",
536 | "digital watch",
537 | "dining table",
538 | "dishcloth",
539 | "dishwasher",
540 | "disc brake",
541 | "dock",
542 | "dog sled",
543 | "dome",
544 | "doormat",
545 | "drilling rig",
546 | "drum",
547 | "drumstick",
548 | "dumbbell",
549 | "Dutch oven",
550 | "electric fan",
551 | "electric guitar",
552 | "electric locomotive",
553 | "entertainment center",
554 | "envelope",
555 | "espresso machine",
556 | "face powder",
557 | "feather boa",
558 | "filing cabinet",
559 | "fireboat",
560 | "fire engine",
561 | "fire screen sheet",
562 | "flagpole",
563 | "flute",
564 | "folding chair",
565 | "football helmet",
566 | "forklift",
567 | "fountain",
568 | "fountain pen",
569 | "four-poster bed",
570 | "freight car",
571 | "French horn",
572 | "frying pan",
573 | "fur coat",
574 | "garbage truck",
575 | "gas mask",
576 | "gas pump",
577 | "goblet",
578 | "go-kart",
579 | "golf ball",
580 | "golf cart",
581 | "gondola",
582 | "gong",
583 | "gown",
584 | "grand piano",
585 | "greenhouse",
586 | "grille",
587 | "grocery store",
588 | "guillotine",
589 | "barrette",
590 | "hair spray",
591 | "half-track",
592 | "hammer",
593 | "hamper",
594 | "hair dryer",
595 | "hand-held computer",
596 | "handkerchief",
597 | "hard disk drive",
598 | "harmonica",
599 | "harp",
600 | "harvester",
601 | "hatchet",
602 | "holster",
603 | "home theater",
604 | "honeycomb",
605 | "hook",
606 | "hoop skirt",
607 | "horizontal bar",
608 | "horse-drawn vehicle",
609 | "hourglass",
610 | "iPod",
611 | "clothes iron",
612 | "jack-o'-lantern",
613 | "jeans",
614 | "jeep",
615 | "T-shirt",
616 | "jigsaw puzzle",
617 | "pulled rickshaw",
618 | "joystick",
619 | "kimono",
620 | "knee pad",
621 | "knot",
622 | "lab coat",
623 | "ladle",
624 | "lampshade",
625 | "laptop computer",
626 | "lawn mower",
627 | "lens cap",
628 | "paper knife",
629 | "library",
630 | "lifeboat",
631 | "lighter",
632 | "limousine",
633 | "ocean liner",
634 | "lipstick",
635 | "slip-on shoe",
636 | "lotion",
637 | "speaker",
638 | "loupe",
639 | "sawmill",
640 | "magnetic compass",
641 | "mail bag",
642 | "mailbox",
643 | "tights",
644 | "tank suit",
645 | "manhole cover",
646 | "maraca",
647 | "marimba",
648 | "mask",
649 | "match",
650 | "maypole",
651 | "maze",
652 | "measuring cup",
653 | "medicine chest",
654 | "megalith",
655 | "microphone",
656 | "microwave oven",
657 | "military uniform",
658 | "milk can",
659 | "minibus",
660 | "miniskirt",
661 | "minivan",
662 | "missile",
663 | "mitten",
664 | "mixing bowl",
665 | "mobile home",
666 | "Model T",
667 | "modem",
668 | "monastery",
669 | "monitor",
670 | "moped",
671 | "mortar",
672 | "square academic cap",
673 | "mosque",
674 | "mosquito net",
675 | "scooter",
676 | "mountain bike",
677 | "tent",
678 | "computer mouse",
679 | "mousetrap",
680 | "moving van",
681 | "muzzle",
682 | "nail",
683 | "neck brace",
684 | "necklace",
685 | "nipple",
686 | "notebook computer",
687 | "obelisk",
688 | "oboe",
689 | "ocarina",
690 | "odometer",
691 | "oil filter",
692 | "organ",
693 | "oscilloscope",
694 | "overskirt",
695 | "bullock cart",
696 | "oxygen mask",
697 | "packet",
698 | "paddle",
699 | "paddle wheel",
700 | "padlock",
701 | "paintbrush",
702 | "pajamas",
703 | "palace",
704 | "pan flute",
705 | "paper towel",
706 | "parachute",
707 | "parallel bars",
708 | "park bench",
709 | "parking meter",
710 | "passenger car",
711 | "patio",
712 | "payphone",
713 | "pedestal",
714 | "pencil case",
715 | "pencil sharpener",
716 | "perfume",
717 | "Petri dish",
718 | "photocopier",
719 | "plectrum",
720 | "Pickelhaube",
721 | "picket fence",
722 | "pickup truck",
723 | "pier",
724 | "piggy bank",
725 | "pill bottle",
726 | "pillow",
727 | "ping-pong ball",
728 | "pinwheel",
729 | "pirate ship",
730 | "pitcher",
731 | "hand plane",
732 | "planetarium",
733 | "plastic bag",
734 | "plate rack",
735 | "plow",
736 | "plunger",
737 | "Polaroid camera",
738 | "pole",
739 | "police van",
740 | "poncho",
741 | "billiard table",
742 | "soda bottle",
743 | "pot",
744 | "potter's wheel",
745 | "power drill",
746 | "prayer rug",
747 | "printer",
748 | "prison",
749 | "projectile",
750 | "projector",
751 | "hockey puck",
752 | "punching bag",
753 | "purse",
754 | "quill",
755 | "quilt",
756 | "race car",
757 | "racket",
758 | "radiator",
759 | "radio",
760 | "radio telescope",
761 | "rain barrel",
762 | "recreational vehicle",
763 | "reel",
764 | "reflex camera",
765 | "refrigerator",
766 | "remote control",
767 | "restaurant",
768 | "revolver",
769 | "rifle",
770 | "rocking chair",
771 | "rotisserie",
772 | "eraser",
773 | "rugby ball",
774 | "ruler",
775 | "running shoe",
776 | "safe",
777 | "safety pin",
778 | "salt shaker",
779 | "sandal",
780 | "sarong",
781 | "saxophone",
782 | "scabbard",
783 | "weighing scale",
784 | "school bus",
785 | "schooner",
786 | "scoreboard",
787 | "CRT screen",
788 | "screw",
789 | "screwdriver",
790 | "seat belt",
791 | "sewing machine",
792 | "shield",
793 | "shoe store",
794 | "shoji",
795 | "shopping basket",
796 | "shopping cart",
797 | "shovel",
798 | "shower cap",
799 | "shower curtain",
800 | "ski",
801 | "ski mask",
802 | "sleeping bag",
803 | "slide rule",
804 | "sliding door",
805 | "slot machine",
806 | "snorkel",
807 | "snowmobile",
808 | "snowplow",
809 | "soap dispenser",
810 | "soccer ball",
811 | "sock",
812 | "solar thermal collector",
813 | "sombrero",
814 | "soup bowl",
815 | "space bar",
816 | "space heater",
817 | "space shuttle",
818 | "spatula",
819 | "motorboat",
820 | "spider web",
821 | "spindle",
822 | "sports car",
823 | "spotlight",
824 | "stage",
825 | "steam locomotive",
826 | "through arch bridge",
827 | "steel drum",
828 | "stethoscope",
829 | "scarf",
830 | "stone wall",
831 | "stopwatch",
832 | "stove",
833 | "strainer",
834 | "tram",
835 | "stretcher",
836 | "couch",
837 | "stupa",
838 | "submarine",
839 | "suit",
840 | "sundial",
841 | "sunglass",
842 | "sunglasses",
843 | "sunscreen",
844 | "suspension bridge",
845 | "mop",
846 | "sweatshirt",
847 | "swimsuit",
848 | "swing",
849 | "switch",
850 | "syringe",
851 | "table lamp",
852 | "tank",
853 | "tape player",
854 | "teapot",
855 | "teddy bear",
856 | "television",
857 | "tennis ball",
858 | "thatched roof",
859 | "front curtain",
860 | "thimble",
861 | "threshing machine",
862 | "throne",
863 | "tile roof",
864 | "toaster",
865 | "tobacco shop",
866 | "toilet seat",
867 | "torch",
868 | "totem pole",
869 | "tow truck",
870 | "toy store",
871 | "tractor",
872 | "semi-trailer truck",
873 | "tray",
874 | "trench coat",
875 | "tricycle",
876 | "trimaran",
877 | "tripod",
878 | "triumphal arch",
879 | "trolleybus",
880 | "trombone",
881 | "tub",
882 | "turnstile",
883 | "typewriter keyboard",
884 | "umbrella",
885 | "unicycle",
886 | "upright piano",
887 | "vacuum cleaner",
888 | "vase",
889 | "vault",
890 | "velvet",
891 | "vending machine",
892 | "vestment",
893 | "viaduct",
894 | "violin",
895 | "volleyball",
896 | "waffle iron",
897 | "wall clock",
898 | "wallet",
899 | "wardrobe",
900 | "military aircraft",
901 | "sink",
902 | "washing machine",
903 | "water bottle",
904 | "water jug",
905 | "water tower",
906 | "whiskey jug",
907 | "whistle",
908 | "wig",
909 | "window screen",
910 | "window shade",
911 | "Windsor tie",
912 | "wine bottle",
913 | "wing",
914 | "wok",
915 | "wooden spoon",
916 | "wool",
917 | "split-rail fence",
918 | "shipwreck",
919 | "yawl",
920 | "yurt",
921 | "website",
922 | "comic book",
923 | "crossword",
924 | "traffic sign",
925 | "traffic light",
926 | "dust jacket",
927 | "menu",
928 | "plate",
929 | "guacamole",
930 | "consomme",
931 | "hot pot",
932 | "trifle",
933 | "ice cream",
934 | "ice pop",
935 | "baguette",
936 | "bagel",
937 | "pretzel",
938 | "cheeseburger",
939 | "hot dog",
940 | "mashed potato",
941 | "cabbage",
942 | "broccoli",
943 | "cauliflower",
944 | "zucchini",
945 | "spaghetti squash",
946 | "acorn squash",
947 | "butternut squash",
948 | "cucumber",
949 | "artichoke",
950 | "bell pepper",
951 | "cardoon",
952 | "mushroom",
953 | "Granny Smith",
954 | "strawberry",
955 | "orange",
956 | "lemon",
957 | "fig",
958 | "pineapple",
959 | "banana",
960 | "jackfruit",
961 | "custard apple",
962 | "pomegranate",
963 | "hay",
964 | "carbonara",
965 | "chocolate syrup",
966 | "dough",
967 | "meatloaf",
968 | "pizza",
969 | "pot pie",
970 | "burrito",
971 | "red wine",
972 | "espresso",
973 | "cup",
974 | "eggnog",
975 | "alp",
976 | "bubble",
977 | "cliff",
978 | "coral reef",
979 | "geyser",
980 | "lakeshore",
981 | "promontory",
982 | "shoal",
983 | "seashore",
984 | "valley",
985 | "volcano",
986 | "baseball player",
987 | "bridegroom",
988 | "scuba diver",
989 | "rapeseed",
990 | "daisy",
991 | "yellow lady's slipper",
992 | "corn",
993 | "acorn",
994 | "rose hip",
995 | "horse chestnut seed",
996 | "coral fungus",
997 | "agaric",
998 | "gyromitra",
999 | "stinkhorn mushroom",
1000 | "earth star",
1001 | "hen-of-the-woods",
1002 | "bolete",
1003 | "ear",
1004 | "toilet paper"};
1005 | }
1006 | }
--------------------------------------------------------------------------------
/utils/ModelHelper.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.ML.OnnxRuntime;
2 | using Microsoft.ML.OnnxRuntime.Tensors;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 |
7 | namespace OnnxRuntime.ResNet.Template.utils
8 | {
9 | public static class ModelHelper
10 | {
11 | public static List GetPredictions(Tensor input, string modelFilePath)
12 | {
13 | // Setup inputs
14 | var inputs = new List
15 | {
16 | NamedOnnxValue.CreateFromTensor("data", input)
17 | };
18 |
19 | // Run inference
20 | var session = new InferenceSession(modelFilePath);
21 | var results = session.Run(inputs).First().AsEnumerable();
22 |
23 | // Postprocess to get softmax vector
24 | float sum = results.Sum(x => (float)Math.Exp(x));
25 | List softmax = results.Select(x => (float)Math.Exp(x) / sum).ToList();
26 |
27 | // Extract top 10 predicted classes
28 | List top10 = softmax.Select((x, i) => new Prediction { Label = LabelMap.Labels[i], Confidence = x })
29 | .OrderByDescending(x => x.Confidence)
30 | .Take(10).ToList();
31 | return top10;
32 |
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/utils/Prediction.cs:
--------------------------------------------------------------------------------
1 | namespace OnnxRuntime.ResNet.Template
2 | {
3 | public class Prediction
4 | {
5 | public string Label { get; set; }
6 | public float Confidence { get; set; }
7 | }
8 | }
--------------------------------------------------------------------------------