CaptchaReactNeuron

Details

diff --git a/NeuralNetwork/AppTools/AppTools.csproj b/NeuralNetwork/AppTools/AppTools.csproj
new file mode 100644
index 0000000..db0fe96
--- /dev/null
+++ b/NeuralNetwork/AppTools/AppTools.csproj
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{6E72D126-93BA-49C2-9562-78864E9E8F59}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>AppTools</RootNamespace>
+    <AssemblyName>AppTools</AssemblyName>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="PathProvider.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
diff --git a/NeuralNetwork/AppTools/PathProvider.cs b/NeuralNetwork/AppTools/PathProvider.cs
new file mode 100644
index 0000000..1e2af4f
--- /dev/null
+++ b/NeuralNetwork/AppTools/PathProvider.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AppTools
+{
+    /// <summary>
+    /// Модуль для работы с системной переменной PATH
+    /// </summary>
+    public class PathProvider
+    {
+        static readonly string VarName = "PATH";
+
+        /// <summary>
+        /// Получить список значений
+        /// </summary>
+        /// <returns></returns>
+        public List<string> Get()
+        {
+            return Environment.GetEnvironmentVariable(VarName)
+                .Split(';')
+                .ToList();
+        }
+
+        /// <summary>
+        /// Задать значения переменной
+        /// </summary>
+        /// <param name="path"></param>
+        /// <param name="target"></param>
+        public void Set(List<string> path, EnvironmentVariableTarget target)
+        {
+            StringBuilder path_string = new StringBuilder();
+            foreach (var elem in path)
+                path_string.Append(elem + ";");
+
+            var path_value = path_string.ToString().TrimEnd(';');
+
+            Environment.SetEnvironmentVariable(VarName, path_value, target);
+        }
+
+
+        /// <summary>
+        /// Добавить значение, если такого нет
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="target"></param>
+        public void AddIfNot(string value, EnvironmentVariableTarget target)
+        {
+            var path_values = Get();
+
+            if (path_values.Contains(value))
+            {
+                return;
+            }
+
+            path_values.Add(value);
+            Set(path_values, target);
+        }
+
+    }
+}
diff --git a/NeuralNetwork/AppTools/Properties/AssemblyInfo.cs b/NeuralNetwork/AppTools/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..2ec041e
--- /dev/null
+++ b/NeuralNetwork/AppTools/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
+// связанные со сборкой.
+[assembly: AssemblyTitle("AppTools")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("EPAM Systems")]
+[assembly: AssemblyProduct("AppTools")]
+[assembly: AssemblyCopyright("Copyright © EPAM Systems 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
+[assembly: ComVisible(false)]
+
+// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
+[assembly: Guid("6e72d126-93ba-49c2-9562-78864e9e8f59")]
+
+// Сведения о версии сборки состоят из указанных ниже четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//      Номер сборки
+//      Редакция
+//
+// Можно задать все значения или принять номера сборки и редакции по умолчанию 
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/NeuralNetwork/NeuralNetwork.Model/Services/TextRecognisingService.cs b/NeuralNetwork/NeuralNetwork.Model/Services/TextRecognisingService.cs
index 0b1d3ea..8de5a04 100644
--- a/NeuralNetwork/NeuralNetwork.Model/Services/TextRecognisingService.cs
+++ b/NeuralNetwork/NeuralNetwork.Model/Services/TextRecognisingService.cs
@@ -7,6 +7,7 @@ using System.Threading.Tasks;
 using System.IO;
 using System.Drawing;
 using static NeuralNetwork.PictureWork.PictureWork;
+using NeuralNetwork.Model.Neutral.CNTK;
 
 namespace NeuralNetwork.Model.Services
 {
@@ -55,13 +56,16 @@ namespace NeuralNetwork.Model.Services
                 var collect = FindObjects(BitmapToFloatMatrixRgbQ(bitmap));
                 if (collect.Length == 1)
                 {
-                    var byteList = BitmapToFloatArrayRgbQ(new Bitmap(bitmap.Clone(collect.First(), bitmap.PixelFormat), new Size(28, 28))).Select(e => (byte)Math.Round(e * 256f)).ToList();
-                    using (StreamWriter wr = new StreamWriter(@"D:\dataset.csv", true))
-                    {
-                        wr.Write("0");
-                        byteList.ForEach(e => wr.Write("," + e));
-                        wr.WriteLine();
-                    }
+                    var floatArray = BitmapToFloatArrayRgbQ(InsertBitmap(new Bitmap(bitmap.Clone(collect.First(), bitmap.PixelFormat), new Size(20, 20)), 28, 28));
+                    //var byteList = floatArray.Select(e => (byte)Math.Round(e * 256f)).ToList();
+                    //using (StreamWriter wr = new StreamWriter(@"D:\dataset.csv", true))
+                    //{
+                    //    wr.Write("0");
+                    //    byteList.ForEach(e => wr.Write("," + e));
+                    //    wr.WriteLine();
+                    //}
+                    var res = MNIST.GetNumber(floatArray);
+                    return res;
                 }
             }
 
diff --git a/NeuralNetwork/NeuralNetwork.Neutral/CNTK/MNIST.cs b/NeuralNetwork/NeuralNetwork.Neutral/CNTK/MNIST.cs
index d5404f2..37e1993 100644
--- a/NeuralNetwork/NeuralNetwork.Neutral/CNTK/MNIST.cs
+++ b/NeuralNetwork/NeuralNetwork.Neutral/CNTK/MNIST.cs
@@ -65,8 +65,12 @@ namespace NeuralNetwork.Model.Neutral.CNTK
         private void Train(Digit[] trainData)
         {
             TrainingParameterScheduleDouble learningRatePerSample = new TrainingParameterScheduleDouble(0.02, 1);
+
             IList<Learner> parameterLearners =
-                new List<Learner>() { Learner.SGDLearner(z.Parameters(), learningRatePerSample) };
+                new List<Learner>()
+                {
+                    Learner.SGDLearner(z.Parameters(), learningRatePerSample)
+                };
             var trainer = Trainer.CreateTrainer(z, loss, evalError, parameterLearners);
 
             var feat = new BatchSource<float[]>((from x in trainData select x.Image).ToArray(), minibatchSize);
diff --git a/NeuralNetwork/NeuralNetwork.PictureWork/PictureWork.cs b/NeuralNetwork/NeuralNetwork.PictureWork/PictureWork.cs
index fd99c27..1ac5575 100644
--- a/NeuralNetwork/NeuralNetwork.PictureWork/PictureWork.cs
+++ b/NeuralNetwork/NeuralNetwork.PictureWork/PictureWork.cs
@@ -185,5 +185,15 @@ namespace NeuralNetwork.PictureWork
             }
             return _array;
         }
+
+        public static Bitmap InsertBitmap(Bitmap src, int targetWidth, int targetHeight)
+        {
+            Bitmap target = new Bitmap(targetWidth, targetHeight);
+            Graphics g = Graphics.FromImage(target);
+            g.Clear(Color.White);
+            g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
+            g.DrawImage(src, 4, 4);
+            return target;
+        }
     }
 }
diff --git a/NeuralNetwork/NeuralNetwork.sln b/NeuralNetwork/NeuralNetwork.sln
index f5f103f..602434e 100644
--- a/NeuralNetwork/NeuralNetwork.sln
+++ b/NeuralNetwork/NeuralNetwork.sln
@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28307.902
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29326.143
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeuralNetwork.UI.Web", "NeuralNetwork.UI.Web\NeuralNetwork.UI.Web.csproj", "{88084A38-C944-4A74-8516-62ECBF3CCA8F}"
 EndProject
@@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeuralNetwork.PictureWork",
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeuralNetwork.Neutral", "NeuralNetwork.Neutral\NeuralNetwork.Neutral.csproj", "{4367A5A8-8BD8-4E9C-AAC1-5B44A97D9114}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppTools", "AppTools\AppTools.csproj", "{6E72D126-93BA-49C2-9562-78864E9E8F59}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -67,6 +69,14 @@ Global
 		{4367A5A8-8BD8-4E9C-AAC1-5B44A97D9114}.Release|Any CPU.Build.0 = Release|Any CPU
 		{4367A5A8-8BD8-4E9C-AAC1-5B44A97D9114}.Release|x64.ActiveCfg = Release|x64
 		{4367A5A8-8BD8-4E9C-AAC1-5B44A97D9114}.Release|x64.Build.0 = Release|x64
+		{6E72D126-93BA-49C2-9562-78864E9E8F59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6E72D126-93BA-49C2-9562-78864E9E8F59}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6E72D126-93BA-49C2-9562-78864E9E8F59}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{6E72D126-93BA-49C2-9562-78864E9E8F59}.Debug|x64.Build.0 = Debug|Any CPU
+		{6E72D126-93BA-49C2-9562-78864E9E8F59}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6E72D126-93BA-49C2-9562-78864E9E8F59}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6E72D126-93BA-49C2-9562-78864E9E8F59}.Release|x64.ActiveCfg = Release|Any CPU
+		{6E72D126-93BA-49C2-9562-78864E9E8F59}.Release|x64.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -77,6 +87,7 @@ Global
 		{17108848-71BC-4365-9FF3-1F85325D3A90} = {01099921-FF3F-41A0-A5A4-C25D5FC67955}
 		{31FD7758-278B-4174-9BDA-67925FE9425C} = {F2595A9F-D201-4C34-A7B9-ECB1984CB08B}
 		{4367A5A8-8BD8-4E9C-AAC1-5B44A97D9114} = {F2595A9F-D201-4C34-A7B9-ECB1984CB08B}
+		{6E72D126-93BA-49C2-9562-78864E9E8F59} = {F2595A9F-D201-4C34-A7B9-ECB1984CB08B}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {49A42B57-552B-43CA-B057-3424BB708E0C}
diff --git a/NeuralNetwork/NeuralNetwork.Test/NeuralNetwork.Test.csproj b/NeuralNetwork/NeuralNetwork.Test/NeuralNetwork.Test.csproj
index 0dc9e3b..cd027ed 100644
--- a/NeuralNetwork/NeuralNetwork.Test/NeuralNetwork.Test.csproj
+++ b/NeuralNetwork/NeuralNetwork.Test/NeuralNetwork.Test.csproj
@@ -71,14 +71,14 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-  <ItemGroup>
     <ProjectReference Include="..\NeuralNetwork.Model\NeuralNetwork.Model.csproj">
       <Project>{6ba7a7d0-656c-4da9-af2a-12096d5d3030}</Project>
       <Name>NeuralNetwork.Model</Name>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+  </ItemGroup>
   <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
diff --git a/NeuralNetwork/NeuralNetwork.UI.Web/Global.asax.cs b/NeuralNetwork/NeuralNetwork.UI.Web/Global.asax.cs
index 500cd27..25d49c6 100644
--- a/NeuralNetwork/NeuralNetwork.UI.Web/Global.asax.cs
+++ b/NeuralNetwork/NeuralNetwork.UI.Web/Global.asax.cs
@@ -6,10 +6,15 @@ using System.Web.Mvc;
 using System.Web.Optimization;
 using System.Web.Routing;
 
+using System.IO;
+
+using AppTools;
+
 namespace NeuralNetwork.UI.Web
 {
     public class MvcApplication : System.Web.HttpApplication
     {
+
         protected void Application_Start()
         {
             AreaRegistration.RegisterAllAreas();
@@ -17,7 +22,32 @@ namespace NeuralNetwork.UI.Web
             RouteConfig.RegisterRoutes(RouteTable.Routes);
             BundleConfig.RegisterBundles(BundleTable.Bundles);
 
-            NeuralNetwork.Model.Neutral.CNTK.MNIST.Init(Server.MapPath("~/App_Data/train.csv"));
+            AddBinToPathVar();
+            TestNetworkRun();
+            GCClear();
+        }
+
+
+        private void TestNetworkRun() 
+        {
+            string path_App_Data = Server.MapPath("~/App_Data");
+            string path_DataSet = Path.Combine(path_App_Data, "train.csv");
+
+            NeuralNetwork.Model.Neutral.CNTK.MNIST.Init(path_DataSet);
         }
+
+        private void AddBinToPathVar()
+        {
+            string path_bin = Server.MapPath("~/bin");
+
+            PathProvider pp = new PathProvider();
+            pp.AddIfNot(path_bin, EnvironmentVariableTarget.Process);
+        }
+
+        private void GCClear()
+        {
+            GC.Collect();
+        }
+
     }
 }
diff --git a/NeuralNetwork/NeuralNetwork.UI.Web/NeuralNetwork.UI.Web.csproj b/NeuralNetwork/NeuralNetwork.UI.Web/NeuralNetwork.UI.Web.csproj
index c258bbd..80bc7ae 100644
--- a/NeuralNetwork/NeuralNetwork.UI.Web/NeuralNetwork.UI.Web.csproj
+++ b/NeuralNetwork/NeuralNetwork.UI.Web/NeuralNetwork.UI.Web.csproj
@@ -25,6 +25,7 @@
     <UseGlobalApplicationHostFile />
     <NuGetPackageImportStamp>
     </NuGetPackageImportStamp>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -45,75 +46,63 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
+      <HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
+    </Reference>
     <Reference Include="Microsoft.CSharp" />
+    <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
+    </Reference>
+    <Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
+    <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="System.Drawing" />
     <Reference Include="System.Web.DynamicData" />
     <Reference Include="System.Web.Entity" />
     <Reference Include="System.Web.ApplicationServices" />
     <Reference Include="System.ComponentModel.DataAnnotations" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Web" />
     <Reference Include="System.Web.Extensions" />
-    <Reference Include="System.Web.Abstractions" />
-    <Reference Include="System.Web.Routing" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Configuration" />
-    <Reference Include="System.Web.Services" />
-    <Reference Include="System.EnterpriseServices" />
-    <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <Private>True</Private>
-      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Net.Http">
-    </Reference>
-    <Reference Include="System.Net.Http.WebRequest">
-    </Reference>
     <Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <Private>True</Private>
       <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <Private>True</Private>
       <HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
     </Reference>
-    <Reference Include="System.Web.Optimization">
+    <Reference Include="System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
       <HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <Private>True</Private>
       <HintPath>..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <Private>True</Private>
       <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <Private>True</Private>
       <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <Private>True</Private>
       <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
     </Reference>
-    <Reference Include="Newtonsoft.Json">
-      <HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
-    </Reference>
-    <Reference Include="WebGrease">
-      <Private>True</Private>
-      <HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
+    <Reference Include="System.Web" />
+    <Reference Include="System.Web.Abstractions" />
+    <Reference Include="System.Web.Routing" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Configuration" />
+    <Reference Include="System.Web.Services" />
+    <Reference Include="System.EnterpriseServices" />
+    <Reference Include="System.Net.Http">
     </Reference>
-    <Reference Include="Antlr3.Runtime">
-      <Private>True</Private>
-      <HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
+    <Reference Include="System.Net.Http.WebRequest">
     </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
-      <HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="WebGrease, Version=1.6.5135.21930, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -137,6 +126,11 @@
     <Content Include="fonts\glyphicons-halflings-regular.svg" />
     <Content Include="Global.asax" />
     <Content Include="Content\Site\Site.css" />
+    <Content Include="fonts\glyphicons-halflings-regular.woff2" />
+    <Content Include="fonts\glyphicons-halflings-regular.woff" />
+    <Content Include="fonts\glyphicons-halflings-regular.ttf" />
+    <Content Include="fonts\glyphicons-halflings-regular.eot" />
+    <None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
     <Content Include="Scripts\Site\Api\API_TextRecognising.js" />
     <Content Include="Scripts\Site\Pages\AppPage.js" />
     <Content Include="Scripts\Site\Pages\ReactAppPage.jsx" />
@@ -164,17 +158,14 @@
     <Folder Include="Views\TextRecognising\" />
   </ItemGroup>
   <ItemGroup>
-    <Content Include="fonts\glyphicons-halflings-regular.woff2" />
-    <Content Include="fonts\glyphicons-halflings-regular.woff" />
-    <Content Include="fonts\glyphicons-halflings-regular.ttf" />
-    <Content Include="fonts\glyphicons-halflings-regular.eot" />
-    <Content Include="App_Data\train.csv">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
+    <Content Include="App_Data\train.csv" />
     <None Include="packages.config" />
-    <None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\AppTools\AppTools.csproj">
+      <Project>{6e72d126-93ba-49c2-9562-78864e9e8f59}</Project>
+      <Name>AppTools</Name>
+    </ProjectReference>
     <ProjectReference Include="..\NeuralNetwork.Model\NeuralNetwork.Model.csproj">
       <Project>{6ba7a7d0-656c-4da9-af2a-12096d5d3030}</Project>
       <Name>NeuralNetwork.Model</Name>
@@ -183,6 +174,10 @@
       <Project>{4367a5a8-8bd8-4e9c-aac1-5b44a97d9114}</Project>
       <Name>NeuralNetwork.Neutral</Name>
     </ProjectReference>
+    <ProjectReference Include="..\NeuralNetwork.PictureWork\NeuralNetwork.PictureWork.csproj">
+      <Project>{31fd7758-278b-4174-9bda-67925fe9425c}</Project>
+      <Name>NeuralNetwork.PictureWork</Name>
+    </ProjectReference>
   </ItemGroup>
   <PropertyGroup>
     <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
diff --git a/NeuralNetwork/NeuralNetwork.UI.Web/Properties/PublishProfiles/FolderProfile.pubxml b/NeuralNetwork/NeuralNetwork.UI.Web/Properties/PublishProfiles/FolderProfile.pubxml
index 50f4267..86e63ad 100644
--- a/NeuralNetwork/NeuralNetwork.UI.Web/Properties/PublishProfiles/FolderProfile.pubxml
+++ b/NeuralNetwork/NeuralNetwork.UI.Web/Properties/PublishProfiles/FolderProfile.pubxml
@@ -11,12 +11,12 @@
     <LastUsedPlatform>x64</LastUsedPlatform>
     <SiteUrlToLaunchAfterPublish />
     <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
-    <ExcludeApp_Data>False</ExcludeApp_Data>
-    <publishUrl>X:\Publish\NeuralNetwork</publishUrl>
-    <DeleteExistingFiles>True</DeleteExistingFiles>
     <PrecompileBeforePublish>True</PrecompileBeforePublish>
     <EnableUpdateable>True</EnableUpdateable>
     <DebugSymbols>False</DebugSymbols>
     <WDPMergeOption>DonotMerge</WDPMergeOption>
+    <ExcludeApp_Data>False</ExcludeApp_Data>
+    <publishUrl>bin\Release\Publish</publishUrl>
+    <DeleteExistingFiles>True</DeleteExistingFiles>
   </PropertyGroup>
 </Project>
\ No newline at end of file
diff --git a/NeuralNetwork/NeuralNetwork.UI.Web/Properties/PublishProfiles/FolderProfile.pubxml.user b/NeuralNetwork/NeuralNetwork.UI.Web/Properties/PublishProfiles/FolderProfile.pubxml.user
index 936ff58..5cc87ad 100644
--- a/NeuralNetwork/NeuralNetwork.UI.Web/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/NeuralNetwork/NeuralNetwork.UI.Web/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -73,7 +73,7 @@
       <publishTime>04/17/2019 20:07:06</publishTime>
     </File>
     <File Include="bin/NeuralNetwork.Model.dll">
-      <publishTime>12/15/2019 15:44:54</publishTime>
+      <publishTime>12/15/2019 14:32:57</publishTime>
     </File>
     <File Include="bin/NeuralNetwork.Model.pdb">
       <publishTime>12/15/2019 15:44:54</publishTime>
@@ -364,7 +364,7 @@
       <publishTime>12/07/2019 19:18:50</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>12/15/2019 15:44:54</publishTime>
+      <publishTime>12/15/2019 14:40:04</publishTime>
     </File>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/NeuralNetwork/NeuralNetwork.UI.Web/Scripts/Site/Pages/ReactAppPage.jsx b/NeuralNetwork/NeuralNetwork.UI.Web/Scripts/Site/Pages/ReactAppPage.jsx
index bac3149..39d2665 100644
--- a/NeuralNetwork/NeuralNetwork.UI.Web/Scripts/Site/Pages/ReactAppPage.jsx
+++ b/NeuralNetwork/NeuralNetwork.UI.Web/Scripts/Site/Pages/ReactAppPage.jsx
@@ -40,7 +40,7 @@ class ReactAppPage extends React.Component {
         return (
             <div>
                 <div className="CanvasContainer">
-                    <canvas ref={"CanvasElem"} width="500" height="300"></canvas>
+                    <canvas ref={"CanvasElem"} width="500" height="300"/>
                 </div>
 
                 <button
@@ -60,7 +60,7 @@ class ReactAppPage extends React.Component {
                     <div className="input-group-prepend">
                         <span className="input-group-text" id="basic-addon1">Result:</span>
                     </div>
-                    <input type="text" readonly="readonly" value={this.state.TextRecognising_Result} className="form-control" aria-describedby="basic-addon1"></input>
+                    <input type="text" readonly="readonly" value={this.state.TextRecognising_Result} className="form-control" aria-describedby="basic-addon1"/>
                 </div>
             </div>
         );
diff --git a/NeuralNetwork/NeuralNetwork.UI.Web/Scripts/Site/Pages/TestPage.js b/NeuralNetwork/NeuralNetwork.UI.Web/Scripts/Site/Pages/TestPage.js
index 6353fa8..46ca3ae 100644
--- a/NeuralNetwork/NeuralNetwork.UI.Web/Scripts/Site/Pages/TestPage.js
+++ b/NeuralNetwork/NeuralNetwork.UI.Web/Scripts/Site/Pages/TestPage.js
@@ -7,9 +7,9 @@ var canvas;
 function ready() {
     api = new API_TextRecognising();
 
-      canvas = new Canvas(document.getElementById("Canvas"));
-	  canvas.Set_UserWrite(true);
-	  canvas.PrintLine();
+    canvas = new Canvas(document.getElementById("Canvas"));
+	canvas.Set_UserWrite(true);
+	canvas.PrintLine();
   }
 
   document.addEventListener("DOMContentLoaded", ready);
\ No newline at end of file
diff --git a/NeuralNetwork/NeuralNetwork.UI.Web/Web.config b/NeuralNetwork/NeuralNetwork.UI.Web/Web.config
index e124a5c..197562b 100644
--- a/NeuralNetwork/NeuralNetwork.UI.Web/Web.config
+++ b/NeuralNetwork/NeuralNetwork.UI.Web/Web.config
@@ -1,56 +1,64 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0"?>
 <!--
   Дополнительные сведения о настройке приложения ASP.NET см. на странице
    https://go.microsoft.com/fwlink/?LinkId=301880
   -->
 <configuration>
   <appSettings>
-    <add key="webpages:Version" value="3.0.0.0" />
-    <add key="webpages:Enabled" value="false" />
-    <add key="ClientValidationEnabled" value="true" />
-    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
+    <add key="webpages:Version" value="3.0.0.0"/>
+    <add key="webpages:Enabled" value="false"/>
+    <add key="ClientValidationEnabled" value="true"/>
+    <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
   </appSettings>
+  <!--
+    Описание изменений web.config см. по адресу http://go.microsoft.com/fwlink/?LinkId=235367.
+
+    Следующие атрибуты можно установить с помощью тега <httpRuntime>.
+      <system.Web>
+        <httpRuntime targetFramework="4.5" />
+      </system.Web>
+  -->
   <system.web>
-    <compilation debug="true" targetFramework="4.7.2" />
-    <httpRuntime targetFramework="4.7.2" />
+    <compilation debug="true" targetFramework="4.7.2"/>
+    <httpRuntime targetFramework="4.5"/>
     <customErrors mode="Off"/>
   </system.web>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
-        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
-        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
+        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f"/>
+        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
-        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
+        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
+        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
-        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
+        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
+        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
-        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
+        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
-        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
+        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
+        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
-        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
+        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
+        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
-        <bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
+        <bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0"/>
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
   <system.codedom>
     <compilers>
-      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
-      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
+      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
+      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
     </compilers>
   </system.codedom>
-</configuration>
+</configuration>
\ No newline at end of file