├── CognitiveServicesDemo ├── Views │ ├── _ViewStart.cshtml │ ├── Shared │ │ ├── _Upload.cshtml │ │ ├── Error.cshtml │ │ └── _Layout.cshtml │ ├── Home │ │ └── Index.cshtml │ └── Web.config ├── Areas │ ├── Faces │ │ ├── Views │ │ │ ├── _ViewStart.cshtml │ │ │ ├── Detect │ │ │ │ ├── Index.cshtml │ │ │ │ ├── _UploadWithPersonGroups.cshtml │ │ │ │ ├── Identify.cshtml │ │ │ │ ├── Emotions.cshtml │ │ │ │ └── Attributes.cshtml │ │ │ ├── People │ │ │ │ ├── AddFace.cshtml │ │ │ │ ├── Index.cshtml │ │ │ │ ├── Details.cshtml │ │ │ │ └── Edit.cshtml │ │ │ ├── Shared │ │ │ │ └── _FacesMenu.cshtml │ │ │ ├── PersonGroups │ │ │ │ ├── Index.cshtml │ │ │ │ ├── Edit.cshtml │ │ │ │ ├── Create.cshtml │ │ │ │ └── Details.cshtml │ │ │ └── web.config │ │ ├── Models │ │ │ ├── PersonGroupDetailsModel.cs │ │ │ └── IdentifyFacesModel.cs │ │ ├── Controllers │ │ │ ├── HomeController.cs │ │ │ ├── PersonGroupsController.cs │ │ │ ├── PeopleController.cs │ │ │ ├── FacesBaseController.cs │ │ │ └── DetectController.cs │ │ └── FacesAreaRegistration.cs │ ├── ComputerVision │ │ ├── Views │ │ │ ├── _ViewStart.cshtml │ │ │ ├── Shared │ │ │ │ └── _ComputerVisionMenu.cshtml │ │ │ ├── Text │ │ │ │ └── Index.cshtml │ │ │ ├── Handwriting │ │ │ │ └── Index.cshtml │ │ │ ├── web.config │ │ │ └── Describe │ │ │ │ └── Index.cshtml │ │ ├── Models │ │ │ ├── DescribeImageModel.cs │ │ │ ├── RecognizeTextModel.cs │ │ │ └── HandwritingModel.cs │ │ ├── Controllers │ │ │ ├── HomeController.cs │ │ │ ├── TextController.cs │ │ │ ├── HandwritingController.cs │ │ │ ├── DescribeController.cs │ │ │ └── ComputerVisionBaseController.cs │ │ └── ComputerVisionAreaRegistration.cs │ └── ImageUsingBaseController.cs ├── favicon.ico ├── Global.asax ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── Models │ └── ErrorModel.cs ├── Controllers │ └── HomeController.cs ├── App_Start │ ├── FilterConfig.cs │ ├── RouteConfig.cs │ └── BundleConfig.cs ├── Settings.cs ├── Global.asax.cs ├── Content │ └── Site.css ├── Web.Debug.config ├── Web.Release.config ├── Properties │ └── AssemblyInfo.cs ├── packages.config ├── Scripts │ ├── respond.min.js │ ├── respond.matchmedia.addListener.min.js │ ├── jquery.validate.unobtrusive.min.js │ ├── respond.js │ ├── respond.matchmedia.addListener.js │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.min.js ├── Web.config └── CognitiveServicesDemo.csproj ├── README.md ├── CognitiveServicesDemo.sln └── .gitignore /CognitiveServicesDemo/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /CognitiveServicesDemo/Areas/Faces/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /CognitiveServicesDemo/Areas/ComputerVision/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /CognitiveServicesDemo/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpeipman/CognitiveServicesDemo/HEAD/CognitiveServicesDemo/favicon.ico -------------------------------------------------------------------------------- /CognitiveServicesDemo/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="CognitiveServicesDemo.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /CognitiveServicesDemo/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpeipman/CognitiveServicesDemo/HEAD/CognitiveServicesDemo/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /CognitiveServicesDemo/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpeipman/CognitiveServicesDemo/HEAD/CognitiveServicesDemo/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /CognitiveServicesDemo/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpeipman/CognitiveServicesDemo/HEAD/CognitiveServicesDemo/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /CognitiveServicesDemo/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpeipman/CognitiveServicesDemo/HEAD/CognitiveServicesDemo/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /CognitiveServicesDemo/Models/ErrorModel.cs: -------------------------------------------------------------------------------- 1 | namespace CognitiveServicesDemo.Models 2 | { 3 | public class ErrorModel 4 | { 5 | public string Code; 6 | public string Message; 7 | } 8 | } -------------------------------------------------------------------------------- /CognitiveServicesDemo/Areas/Faces/Views/Detect/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model string 2 | 3 |
@(Model?.Message)
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CognitiveServicesDemo/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace CognitiveServicesDemo 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CognitiveServicesDemo/Areas/ComputerVision/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace CognitiveServicesDemo.Areas.ComputerVision.Controllers 4 | { 5 | public class HomeController : Controller 6 | { 7 | public ActionResult Index() 8 | { 9 | return RedirectToAction("Index", "Describe"); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /CognitiveServicesDemo/Areas/Faces/Views/Detect/_UploadWithPersonGroups.cshtml: -------------------------------------------------------------------------------- 1 | @model IList11 | @if (Model != null && !string.IsNullOrEmpty(Model.ImageDump)) 12 | { 13 |
9 | @Html.ActionLink("Create New", "Create") 10 |
11 | 12 || ID | 15 |Name | 16 |17 | |
|---|---|---|
| @item.PersonGroupId | 23 |@item.Name | 24 |25 | @Html.ActionLink("Details", "Details", new { id = item.PersonGroupId }) | 26 | @Html.ActionLink("Edit", "Edit", new { id = item.PersonGroupId }) | 27 | @Html.ActionLink("Train", "Train", new { id = item.PersonGroupId }) | 28 | @Html.ActionLink("People", "Index", "People", new { id = item.PersonGroupId }, new { }) | 29 | @Html.ActionLink("Delete", "Delete", new { id = item.PersonGroupId }) 30 | | 31 |
9 | @Html.ActionLink("Create New", "Create", new { id = ViewBag.PersonGroupId }) 10 |
11 | 12 || ID | 15 |Name | 16 |17 | |
|---|---|---|
| @item.PersonId | 23 |@item.Name | 24 |25 | @Html.ActionLink("Details", "Details", new { id = ViewBag.PersonGroupId, personId = item.PersonId }) | 26 | @Html.ActionLink("Edit", "Edit", new { id = ViewBag.PersonGroupId, personId = item.PersonId }) | 27 | @Html.ActionLink("Add face", "AddFace", new { id = ViewBag.PersonGroupId, personId = item.PersonId }) | 28 | @Html.ActionLink("Delete", "Delete", new { id = ViewBag.PersonGroupId, personId = item.PersonId }) 29 | | 30 |
45 | @Html.ActionLink("Back to List", "Index", new { id = Request.RequestContext.RouteData.Values["id"] }) 46 |
-------------------------------------------------------------------------------- /CognitiveServicesDemo/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.
8 | 9 |15 | ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that 16 | enables a clean separation of concerns and gives you full control over markup 17 | for enjoyable, agile development. 18 |
19 | 20 |NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.
24 | 25 |You can easily find a web hosting company that offers the right mix of features and price for your applications.
29 | 30 |77 | @Html.ActionLink("Back to List", "Index") 78 |
-------------------------------------------------------------------------------- /CognitiveServicesDemo/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 || Adult content | 17 |@Model.Result.Adult.IsAdultContent | 18 |
|---|---|
| Racy content | 21 |@Model.Result.Adult.IsRacyContent | 22 |
| Categories | 25 |@string.Join(", ", Model.Result.Categories.Select(c => c.Name + " (" + c.Detail + ")").ToArray()) | 26 |
| Accent color | 29 |@Model.Result.Color.AccentColor | 30 |
| Dominant background color | 33 |@Model.Result.Color.DominantColorBackground | 34 |
| Dominant foreground color | 37 |@Model.Result.Color.DominantColorForeground | 38 |
| Dominant colors | 41 |@string.Join(", ", Model.Result.Color.DominantColors) | 42 |
| Black-white | 45 |@Model.Result.Color.IsBWImg | 46 |
| Description | 49 |
50 | @foreach(var cap in Model.Result.Description.Captions)
51 | {
52 | |
55 |
| Clip art type | 58 |@Model.Result.ImageType.ClipArtType | 59 |
| Line drawing type | 62 |@Model.Result.ImageType.LineDrawingType | 63 |
| Metadata | 66 |@Model.Result.Metadata.Format (@Model.Result.Metadata.Width x @Model.Result.Metadata.Height) | 67 |
| Tags | 70 |@string.Join(", ", Model.Result.Tags.Select(t => t.Name).ToArray()) | 71 |
| 25 | | Person | 26 |Anger | 27 |Contempt | 28 |Disgust | 29 |Fear | 30 |Happiness | 31 |Neutral | 32 |Sadness | 33 |Surprise | 34 |
|---|---|---|---|---|---|---|---|---|---|
| 41 | | @string.Join(", ", face.PersonCandidates.Select(p => p.Value).ToArray()) | 42 |@face.Face.FaceAttributes.Emotion.Anger | 43 |@face.Face.FaceAttributes.Emotion.Contempt | 44 |@face.Face.FaceAttributes.Emotion.Disgust | 45 |@face.Face.FaceAttributes.Emotion.Fear | 46 |@face.Face.FaceAttributes.Emotion.Happiness | 47 |@face.Face.FaceAttributes.Emotion.Neutral | 48 |@face.Face.FaceAttributes.Emotion.Sadness | 49 |@face.Face.FaceAttributes.Emotion.Surprise | 50 |
| Person | 34 |Accessories | 35 |Age | 36 |Blur | 37 |Exposure | 38 |Beard | 39 |Moustache | 40 |Sideburns | 41 |Gender | 42 |Glasses | 43 |Bald | 44 |Hair color | 45 |Hair invisible | 46 |Head pose pitch | 47 |Head pose roll | 48 |Head pose yaw | 49 |Eye makeup | 50 |Lips makeup | 51 |Noise | 52 |Eye occluded | 53 |Forehead occluded | 54 |Mouth occluded | 55 |Smile | 56 ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 63 | 64 | @string.Join(", ", face.PersonCandidates.Select(p => p.Value).ToArray()) 65 | | 66 |
67 | @if (face.Face.FaceAttributes.Accessories != null)
68 | {
69 | foreach (var accessory in face.Face.FaceAttributes.Accessories)
70 | {
71 | |
76 | @face.Face.FaceAttributes.Age.ToString("0") | 77 |@face.Face.FaceAttributes.Blur.BlurLevel | 78 |@face.Face.FaceAttributes.Exposure.ExposureLevel | 79 |@face.Face.FaceAttributes.FacialHair.Beard.ToString("0")% | 80 |@face.Face.FaceAttributes.FacialHair.Moustache.ToString("0")% | 81 |@face.Face.FaceAttributes.FacialHair.Sideburns.ToString("0")% | 82 |@face.Face.FaceAttributes.Gender | 83 |@face.Face.FaceAttributes.Glasses | 84 |@face.Face.FaceAttributes.Hair.Bald.ToString("0")% | 85 | @if (face.Face.FaceAttributes.Hair.HairColor.Length > 0) 86 | { 87 |88 | @string.Join(", ", face.Face.FaceAttributes.Hair.HairColor.Select(c => c.Color.ToString())) 89 | | 90 | } 91 | else 92 | { 93 |94 | } 95 | | @face.Face.FaceAttributes.Hair.Invisible | 96 |@face.Face.FaceAttributes.HeadPose.Pitch | 97 |@face.Face.FaceAttributes.HeadPose.Roll | 98 |@face.Face.FaceAttributes.HeadPose.Yaw | 99 |@face.Face.FaceAttributes.Makeup.EyeMakeup | 100 |@face.Face.FaceAttributes.Makeup.LipMakeup | 101 |@face.Face.FaceAttributes.Noise.NoiseLevel | 102 |@face.Face.FaceAttributes.Occlusion.EyeOccluded | 103 |@face.Face.FaceAttributes.Occlusion.ForeheadOccluded | 104 |@face.Face.FaceAttributes.Occlusion.MouthOccluded | 105 |@face.Face.FaceAttributes.Smile | 106 |