-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from lizaalert/dev
Dev - 0.2.9 release
- Loading branch information
Showing
20 changed files
with
1,172 additions
and
1,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace LaddAugmentor | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Hello World!"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaddGenerator", ".\LaddGenerator\LaddGenerator.csproj", "{D452A77C-D639-4376-8372-BA5B8AC67CF4}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaddValidator", ".\LaddValidator\LaddValidator.csproj", "{C9A6B61C-8F39-4A32-BDA0-6C248153448E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{D452A77C-D639-4376-8372-BA5B8AC67CF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D452A77C-D639-4376-8372-BA5B8AC67CF4}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D452A77C-D639-4376-8372-BA5B8AC67CF4}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D452A77C-D639-4376-8372-BA5B8AC67CF4}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{2C83E9CE-CD86-4B8F-AC3A-60CB7ACB9F07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{2C83E9CE-CD86-4B8F-AC3A-60CB7ACB9F07}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{2C83E9CE-CD86-4B8F-AC3A-60CB7ACB9F07}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{2C83E9CE-CD86-4B8F-AC3A-60CB7ACB9F07}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{C9A6B61C-8F39-4A32-BDA0-6C248153448E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C9A6B61C-8F39-4A32-BDA0-6C248153448E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C9A6B61C-8F39-4A32-BDA0-6C248153448E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C9A6B61C-8F39-4A32-BDA0-6C248153448E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,56 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace LaddGenerator | ||
{ | ||
public class ArgsParser | ||
{ | ||
private readonly Dictionary<string, string> _argsKeys; | ||
|
||
public ArgsParser(Dictionary<string, string> argsKeys) | ||
{ | ||
_argsKeys = argsKeys; | ||
} | ||
|
||
public Dictionary<string, string> Parse(string[] args) | ||
{ | ||
if (args.Length / 2 != _argsKeys.Count) | ||
{ | ||
Console.Write("usage\n"); | ||
foreach (var (key, value) in _argsKeys) | ||
{ | ||
Console.WriteLine($"\t{key}\t{value}"); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
Dictionary<string, string> result = new Dictionary<string, string>(); | ||
foreach (var (key, value) in _argsKeys) | ||
{ | ||
for (int i = 0; i < args.Length; i += 2) | ||
{ | ||
if(args[i].Contains(key)) | ||
result.Add(key.Replace("--", ""), args[i+1]); | ||
} | ||
} | ||
|
||
return result; | ||
} | ||
} | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace LaddGenerator | ||
{ | ||
public class ArgsParser | ||
{ | ||
private readonly Dictionary<string, string> _argsKeys; | ||
|
||
public ArgsParser(Dictionary<string, string> argsKeys) | ||
{ | ||
_argsKeys = argsKeys; | ||
} | ||
|
||
public Dictionary<string, string> Parse(string[] args) | ||
{ | ||
if (args.Length == 0) | ||
{ | ||
List<string> argsList = new List<string>(); | ||
Console.Write("usage\n"); | ||
foreach (var (key, value) in _argsKeys) | ||
{ | ||
Console.WriteLine($"\t{key}\t{value}"); | ||
} | ||
for (int i = 0; i < _argsKeys.Count; i++) | ||
{ | ||
argsList.AddRange(Console.ReadLine()?.Split(' ')); | ||
} | ||
|
||
args = argsList.ToArray(); | ||
} | ||
else if (args.Length / 2 != _argsKeys.Count) | ||
{ | ||
Console.Write("usage\n"); | ||
foreach (var (key, value) in _argsKeys) | ||
{ | ||
Console.WriteLine($"\t{key}\t{value}"); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
Dictionary<string, string> result = new Dictionary<string, string>(); | ||
foreach (var (key, value) in _argsKeys) | ||
{ | ||
for (int i = 0; i < args.Length; i += 2) | ||
{ | ||
if(args[i].Contains(key)) | ||
result.Add(key.Replace("--", ""), args[i+1]); | ||
} | ||
} | ||
|
||
return result; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace LaddValidator | ||
{ | ||
public class ArgsParser | ||
{ | ||
private readonly Dictionary<string, string> _argsKeys; | ||
|
||
public ArgsParser(Dictionary<string, string> argsKeys) | ||
{ | ||
_argsKeys = argsKeys; | ||
} | ||
|
||
public Dictionary<string, string> Parse(string[] args) | ||
{ | ||
if (args.Length == 0) | ||
{ | ||
List<string> argsList = new List<string>(); | ||
Console.Write("usage\n"); | ||
foreach (var (key, value) in _argsKeys) | ||
{ | ||
Console.WriteLine($"\t{key}\t{value}"); | ||
} | ||
for (int i = 0; i < _argsKeys.Count; i++) | ||
{ | ||
argsList.AddRange(Console.ReadLine()?.Split(' ')); | ||
} | ||
|
||
args = argsList.ToArray(); | ||
} | ||
else if (args.Length / 2 != _argsKeys.Count) | ||
{ | ||
Console.Write("usage\n"); | ||
foreach (var (key, value) in _argsKeys) | ||
{ | ||
Console.WriteLine($"\t{key}\t{value}"); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
Dictionary<string, string> result = new Dictionary<string, string>(); | ||
foreach (var (key, value) in _argsKeys) | ||
{ | ||
for (int i = 0; i < args.Length; i += 2) | ||
{ | ||
if(args[i].Contains(key)) | ||
result.Add(key.Replace("--", ""), args[i+1]); | ||
} | ||
} | ||
|
||
return result; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
namespace LaddValidator | ||
{ | ||
class Program | ||
{ | ||
private static readonly Dictionary<string, string> _argsKeys = new Dictionary<string, string>() | ||
{ | ||
{"--src", "source path"}, | ||
{"--val_file", "destination path"}, | ||
}; | ||
|
||
static void Main(string[] args) | ||
{ | ||
var parser = new ArgsParser(_argsKeys); | ||
var parsedArgs = parser.Parse(args); | ||
if (parsedArgs == null) | ||
{ | ||
return; | ||
} | ||
var splitPatch = parsedArgs["src"] + "ImageSets/Main/"; | ||
var valFilePatch = parsedArgs["val_file"]; | ||
if (!Directory.Exists(splitPatch)) | ||
{ | ||
Console.Write("unable to open: " + splitPatch); | ||
return; | ||
} | ||
if (!File.Exists(valFilePatch)) | ||
{ | ||
Console.Write("unable to open: " + valFilePatch); | ||
return; | ||
} | ||
|
||
var valLines = File.ReadLines(valFilePatch).ToList(); | ||
var trainLines = File.ReadLines(splitPatch + "train.txt").ToList(); | ||
var testLines = File.ReadLines(splitPatch + "test.txt").ToList(); | ||
trainLines.AddRange(testLines); | ||
|
||
for (int i = 0; i < trainLines.Count; i++) | ||
{ | ||
for (int j = 0; j < valLines.Count; j++) | ||
{ | ||
if (valLines[j] == trainLines[i]) | ||
{ | ||
trainLines.RemoveAt(i); | ||
Console.WriteLine($"{valLines[j]} moved to val set"); | ||
if(i>0) | ||
i--; | ||
} | ||
} | ||
} | ||
Shuffle(valLines); | ||
File.WriteAllLines(splitPatch+"train.txt", trainLines); | ||
File.WriteAllLines(splitPatch+"trainval.txt", trainLines); | ||
File.WriteAllLines(splitPatch+"test.txt", valLines); | ||
File.WriteAllLines(splitPatch+"val.txt", valLines); | ||
} | ||
|
||
private static void Shuffle<T>(IList<T> list) | ||
{ | ||
Random rng = new Random(); | ||
int n = list.Count; | ||
while (n > 1) { | ||
n--; | ||
int k = rng.Next(n + 1); | ||
T value = list[k]; | ||
list[k] = list[n]; | ||
list[n] = value; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ internal static class Program | |
{ | ||
private static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Lacmus desktop application. Version 0.2.7 alpha. \nCopyright (c) 2019 Georgy Perevozghikov <[email protected]>\nGithub page: https://github.com/lizaalert/lacmus/.\nProvided by Yandex Cloud: https://cloud.yandex.com/."); | ||
Console.WriteLine("Lacmus desktop application. Version 0.2.9 alpha. \nCopyright (c) 2019 Georgy Perevozghikov <[email protected]>\nGithub page: https://github.com/lizaalert/lacmus/.\nProvided by Yandex Cloud: https://cloud.yandex.com/."); | ||
Console.WriteLine("This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'."); | ||
Console.WriteLine("This is free software, and you are welcome to redistribute it\nunder certain conditions; type `show c' for details."); | ||
Console.WriteLine("------------------------------------"); | ||
|
Oops, something went wrong.