Skip to content

Commit 018e9eb

Browse files
committed
add codes
1 parent 88c4c40 commit 018e9eb

26 files changed

Lines changed: 1514 additions & 0 deletions

.vs/ConsoleApplication1/v14/.suo

57.5 KB
Binary file not shown.

16_abraham_lincoln.jpg

204 KB
Loading

ConsoleApplication1.VC.VC.opendb

44 Bytes
Binary file not shown.

ConsoleApplication1.sln

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.vcxproj", "{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}.Debug|x64.ActiveCfg = Debug|x64
17+
{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}.Debug|x64.Build.0 = Debug|x64
18+
{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}.Debug|x86.ActiveCfg = Debug|Win32
19+
{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}.Debug|x86.Build.0 = Debug|Win32
20+
{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}.Release|x64.ActiveCfg = Release|x64
21+
{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}.Release|x64.Build.0 = Release|x64
22+
{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}.Release|x86.ActiveCfg = Release|Win32
23+
{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}.Release|x86.Build.0 = Release|Win32
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
EndGlobal
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// ConsoleApplication1.cpp : Defines the entry point for the console application.
2+
//
3+
4+
#include "stdafx.h"
5+
#include "FaceDetectionRestRequest.h"
6+
#include "VisionRestRequest.h"
7+
#include "EmotionRestRequest.h"
8+
9+
int main(int argc, char* argv[])
10+
{
11+
FaceDetectionRestRequest* fq = new FaceDetectionRestRequest();
12+
fq->SendDetectionRequest(L"XXXXXXXXXXXXXXXXXXXXXXXX", L"C:\\Users\\ChangLiu\\Documents\\Visual Studio 2015\\Projects\\ConsoleApplication1\\Debug\\NF_200001_001.jpg");
13+
14+
std::cout << "******************************** Face Detection Test Case *****************************" << std::endl;
15+
std::cout << "smile: " << fq->getSmileConfidenceScore() << std::endl;
16+
std::cout << "gender: " << fq->getGenderValue() << std::endl;
17+
std::cout << "age: " << fq->getAgeValue() << std::endl;
18+
std::cout << "glasses: " << fq->getGlassesValue() << std::endl;
19+
20+
/*
21+
from 0 to 6, the corresponding type is as follows:
22+
{ "Categories", "ImageType", "Faces", "Adult", "Color", "Tags", "Description" };
23+
*/
24+
VisionRestRequest *vq = new VisionRestRequest(6);
25+
vq->SendAnalysisRequest(L"XXXXXXXXXXXXXXXXXXXXXXXX", L"C:\\Users\\ChangLiu\\Documents\\Visual Studio 2015\\Projects\\ConsoleApplication1\\16_abraham_lincoln.jpg");
26+
std::cout << "******************************** Computer Vision Test Case *****************************" << std::endl;
27+
std::cout << vq->getImageCaptionInfo() << std::endl;
28+
std::cout << vq->getImageCaptionConfidenceInfo() << std::endl;
29+
std::cout << vq->getImageCaptionTagsInfo() << std::endl;
30+
//std::cout << vq->getImageTags() << std::endl;
31+
//std::cout << vq->getImageTagsConfidenceInfo() << std::endl;
32+
std::cout << vq->getCategoryNames() << std::endl;
33+
std::cout << vq->getCategoryScores() << std::endl;
34+
35+
36+
std::cout << "******************************** Emotion Test Case *****************************" << std::endl;
37+
EmotionRestRequest *eq = new EmotionRestRequest();
38+
eq->sendEmotionRequest(L"XXXXXXXXXXXXXXXXXXXXXXXX", L"C:\\Users\\ChangLiu\\Documents\\Visual Studio 2015\\Projects\\ConsoleApplication1\\16_abraham_lincoln.jpg");
39+
std::cout << "Anger score: " << eq->getAngerScore() << std::endl;
40+
std::cout << "Contempt score: " << eq->getContemptScore() << std::endl;
41+
std::cout << "Disgust score: " << eq->getDisgustScore() << std::endl;
42+
std::cout << "Fear score: " << eq->getFearScore() << std::endl;
43+
std::cout << "Happiness score: " << eq->getHappinessScore() << std::endl;
44+
std::cout << "Neutral score: " << eq->getNeuralScore() << std::endl;
45+
std::cout << "Sadness score: " << eq->getSadnessScore() << std::endl;
46+
std::cout << "Surprise score: " << eq->getSurpriseScore() << std::endl;
47+
48+
return 0;
49+
}
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<ProjectGuid>{C72BC415-D7EC-41CA-BC38-FB281EBA0B14}</ProjectGuid>
23+
<Keyword>Win32Proj</Keyword>
24+
<RootNamespace>ConsoleApplication1</RootNamespace>
25+
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
26+
</PropertyGroup>
27+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
29+
<ConfigurationType>Application</ConfigurationType>
30+
<UseDebugLibraries>true</UseDebugLibraries>
31+
<PlatformToolset>v140</PlatformToolset>
32+
<CharacterSet>Unicode</CharacterSet>
33+
</PropertyGroup>
34+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
35+
<ConfigurationType>Application</ConfigurationType>
36+
<UseDebugLibraries>false</UseDebugLibraries>
37+
<PlatformToolset>v140</PlatformToolset>
38+
<WholeProgramOptimization>true</WholeProgramOptimization>
39+
<CharacterSet>Unicode</CharacterSet>
40+
</PropertyGroup>
41+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
42+
<ConfigurationType>Application</ConfigurationType>
43+
<UseDebugLibraries>true</UseDebugLibraries>
44+
<PlatformToolset>v140</PlatformToolset>
45+
<CharacterSet>Unicode</CharacterSet>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
48+
<ConfigurationType>Application</ConfigurationType>
49+
<UseDebugLibraries>false</UseDebugLibraries>
50+
<PlatformToolset>v140</PlatformToolset>
51+
<WholeProgramOptimization>true</WholeProgramOptimization>
52+
<CharacterSet>Unicode</CharacterSet>
53+
</PropertyGroup>
54+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
55+
<ImportGroup Label="ExtensionSettings">
56+
</ImportGroup>
57+
<ImportGroup Label="Shared">
58+
</ImportGroup>
59+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
60+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61+
</ImportGroup>
62+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
63+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64+
</ImportGroup>
65+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
66+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
67+
</ImportGroup>
68+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
69+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
70+
</ImportGroup>
71+
<PropertyGroup Label="UserMacros" />
72+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
73+
<LinkIncremental>true</LinkIncremental>
74+
</PropertyGroup>
75+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
76+
<LinkIncremental>true</LinkIncremental>
77+
</PropertyGroup>
78+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
79+
<LinkIncremental>false</LinkIncremental>
80+
</PropertyGroup>
81+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
82+
<LinkIncremental>false</LinkIncremental>
83+
</PropertyGroup>
84+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
85+
<ClCompile>
86+
<PrecompiledHeader>Use</PrecompiledHeader>
87+
<WarningLevel>Level3</WarningLevel>
88+
<Optimization>Disabled</Optimization>
89+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
90+
<SDLCheck>true</SDLCheck>
91+
</ClCompile>
92+
<Link>
93+
<SubSystem>Console</SubSystem>
94+
<GenerateDebugInformation>true</GenerateDebugInformation>
95+
</Link>
96+
</ItemDefinitionGroup>
97+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
98+
<ClCompile>
99+
<PrecompiledHeader>Use</PrecompiledHeader>
100+
<WarningLevel>Level3</WarningLevel>
101+
<Optimization>Disabled</Optimization>
102+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
103+
<SDLCheck>true</SDLCheck>
104+
</ClCompile>
105+
<Link>
106+
<SubSystem>Console</SubSystem>
107+
<GenerateDebugInformation>true</GenerateDebugInformation>
108+
</Link>
109+
</ItemDefinitionGroup>
110+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
111+
<ClCompile>
112+
<WarningLevel>Level3</WarningLevel>
113+
<PrecompiledHeader>Use</PrecompiledHeader>
114+
<Optimization>MaxSpeed</Optimization>
115+
<FunctionLevelLinking>true</FunctionLevelLinking>
116+
<IntrinsicFunctions>true</IntrinsicFunctions>
117+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118+
<SDLCheck>true</SDLCheck>
119+
</ClCompile>
120+
<Link>
121+
<SubSystem>Console</SubSystem>
122+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
123+
<OptimizeReferences>true</OptimizeReferences>
124+
<GenerateDebugInformation>true</GenerateDebugInformation>
125+
</Link>
126+
</ItemDefinitionGroup>
127+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
128+
<ClCompile>
129+
<WarningLevel>Level3</WarningLevel>
130+
<PrecompiledHeader>Use</PrecompiledHeader>
131+
<Optimization>MaxSpeed</Optimization>
132+
<FunctionLevelLinking>true</FunctionLevelLinking>
133+
<IntrinsicFunctions>true</IntrinsicFunctions>
134+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
135+
<SDLCheck>true</SDLCheck>
136+
</ClCompile>
137+
<Link>
138+
<SubSystem>Console</SubSystem>
139+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
140+
<OptimizeReferences>true</OptimizeReferences>
141+
<GenerateDebugInformation>true</GenerateDebugInformation>
142+
</Link>
143+
</ItemDefinitionGroup>
144+
<ItemGroup>
145+
<Text Include="ReadMe.txt" />
146+
</ItemGroup>
147+
<ItemGroup>
148+
<ClInclude Include="EmotionRestRequest.h" />
149+
<ClInclude Include="FaceDetectionRestRequest.h" />
150+
<ClInclude Include="stdafx.h" />
151+
<ClInclude Include="targetver.h" />
152+
<ClInclude Include="VisionRestRequest.h" />
153+
</ItemGroup>
154+
<ItemGroup>
155+
<ClCompile Include="ConsoleApplication1.cpp" />
156+
<ClCompile Include="EmotionRestRequest.cpp" />
157+
<ClCompile Include="FaceDetectionRestRequest.cpp" />
158+
<ClCompile Include="stdafx.cpp">
159+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
160+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
161+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
162+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
163+
</ClCompile>
164+
<ClCompile Include="VisionRestRequest.cpp" />
165+
</ItemGroup>
166+
<ItemGroup>
167+
<None Include="packages.config" />
168+
</ItemGroup>
169+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
170+
<ImportGroup Label="ExtensionTargets">
171+
<Import Project="..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.9.1\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.9.1\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" />
172+
</ImportGroup>
173+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
174+
<PropertyGroup>
175+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
176+
</PropertyGroup>
177+
<Error Condition="!Exists('..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.9.1\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.9.1\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets'))" />
178+
</Target>
179+
</Project>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<Text Include="ReadMe.txt" />
19+
</ItemGroup>
20+
<ItemGroup>
21+
<ClInclude Include="stdafx.h">
22+
<Filter>Header Files</Filter>
23+
</ClInclude>
24+
<ClInclude Include="targetver.h">
25+
<Filter>Header Files</Filter>
26+
</ClInclude>
27+
<ClInclude Include="FaceDetectionRestRequest.h">
28+
<Filter>Header Files</Filter>
29+
</ClInclude>
30+
<ClInclude Include="VisionRestRequest.h">
31+
<Filter>Header Files</Filter>
32+
</ClInclude>
33+
<ClInclude Include="EmotionRestRequest.h">
34+
<Filter>Header Files</Filter>
35+
</ClInclude>
36+
</ItemGroup>
37+
<ItemGroup>
38+
<ClCompile Include="stdafx.cpp">
39+
<Filter>Source Files</Filter>
40+
</ClCompile>
41+
<ClCompile Include="ConsoleApplication1.cpp">
42+
<Filter>Source Files</Filter>
43+
</ClCompile>
44+
<ClCompile Include="FaceDetectionRestRequest.cpp">
45+
<Filter>Source Files</Filter>
46+
</ClCompile>
47+
<ClCompile Include="VisionRestRequest.cpp">
48+
<Filter>Source Files</Filter>
49+
</ClCompile>
50+
<ClCompile Include="EmotionRestRequest.cpp">
51+
<Filter>Source Files</Filter>
52+
</ClCompile>
53+
</ItemGroup>
54+
<ItemGroup>
55+
<None Include="packages.config" />
56+
</ItemGroup>
57+
</Project>

0 commit comments

Comments
 (0)