Skip to content
Snippets Groups Projects
Commit 951f5ff0 authored by Alexis Iakovenko's avatar Alexis Iakovenko
Browse files

Save and load mean to not compute every time

parent 893170e5
No related branches found
No related tags found
No related merge requests found
......@@ -21,9 +21,21 @@ public class Gesture
states = new List<GestureState> ();
this.name = name;
if (type == GestureType.Mean)
ComputeMean ();
LoadMean ();
else if (type == GestureType.Variance)
ComputeVariance ();
LoadVariance ();
}
void LoadMean ()
{
string path = "Assets/Record/Recorded/" + name + "/mean.txt";
if(File.Exists(path))
Load (path);
else
{
ComputeMean ();
Save (path);
}
}
void ComputeMean ()
......@@ -86,6 +98,18 @@ public class Gesture
Debug.Log ("[Gesture:ComputeMean] Finished computing mean " + meanTime);
}
void LoadVariance ()
{
string path = "Assets/Record/Recorded/" + name + "/variance.txt";
if (File.Exists (path))
Load (path);
else
{
ComputeVariance ();
Save (path);
}
}
void ComputeVariance ()
{
}
......@@ -139,6 +163,26 @@ public class Gesture
states = GestureLoader.Load (path);
}
void Save(string path)
{
StreamWriter mStreamWriter;
mStreamWriter = new StreamWriter(path);
mStreamWriter.WriteLine("Gesture: " + name + "; Author: none");
foreach(GestureState state in states)
{
string line = string.Format("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14}", Time.unscaledTime,
state.position.x, state.position.y, state.position.z,
state.rotation.x, state.rotation.y, state.rotation.z, state.rotation.w,
0, 0, 0,
0, 0, 0, 0);
mStreamWriter.WriteLine(line);
}
mStreamWriter.Close();
}
public override string ToString ()
{
return name;
......
Gesture: gesture; Author: none
0 -0.1298404 -0.05070314 0.2408074 -0.4016583 0.4840114 0.516383 0.07830974 0 0 0 0 0 0 0
0 -0.158431 -0.04788817 0.2511487 -0.4593021 0.4239165 0.5102753 0.07829528 0 0 0 0 0 0 0
0 -0.147991 -0.04939978 0.246029 -0.4479118 0.4493795 0.5237485 0.0783334 0 0 0 0 0 0 0
0 -0.1468672 -0.03869705 0.231595 -0.5302466 0.4467072 0.4706523 0.07837162 0 0 0 0 0 0 0
0 -0.1467521 -0.05159814 0.2505346 -0.391147 0.4586476 0.5157737 0.07843956 0 0 0 0 0 0 0
0 -0.1261905 -0.04337013 0.2250092 -0.3372886 0.5159126 0.4858532 0.07832823 0 0 0 0 0 0 0
0 -0.1374219 -0.04665723 0.2390732 -0.4262225 0.4850183 0.5236591 0.07823177 0 0 0 0 0 0 0
0 -0.07028965 -0.06794272 0.1928326 -0.5959031 0.4237085 0.6591919 0.0780577 0 0 0 0 0 0 0
0 -0.137164 -0.05087798 0.2443081 -0.4054677 0.4714885 0.5299931 0.07788051 0 0 0 0 0 0 0
0 -0.268031 -0.06628376 0.3383029 -0.1186105 0.5779956 1.036917 0.07772154 0 0 0 0 0 0 0
0 0.05050784 -0.0227457 0.1042779 -0.7678377 0.4080089 -0.1693602 0.0773307 0 0 0 0 0 0 0
0 -0.1319508 -0.0495696 0.2408904 -0.4109664 0.4765015 0.5064743 0.07703446 0 0 0 0 0 0 0
0 0.1126056 -0.00813543 0.06356751 0.362306 1.307264 0.4605708 0.07727723 0 0 0 0 0 0 0
0 -0.1303253 -0.05122145 0.2411427 -0.4061015 0.4837727 0.5043437 0.07769 0 0 0 0 0 0 0
0 -1.071899 -0.05936358 0.5727734 -1.200125 -0.9884365 0.5457799 0.07814816 0 0 0 0 0 0 0
0 0.9384447 -0.3568369 0.0904684 3.903973 4.973892 2.067838 0.07918294 0 0 0 0 0 0 0
0 -0.1219561 -0.0520927 0.2382685 -0.3851708 0.5089012 0.5013693 0.08016302 0 0 0 0 0 0 0
0 -0.1963221 -0.03382287 0.2409079 -0.6850709 0.2847353 0.5234489 0.08098249 0 0 0 0 0 0 0
0 -0.1350653 -0.04952552 0.2386274 -0.4345192 0.4751121 0.5169742 0.08153272 0 0 0 0 0 0 0
0 -1.091027 0.2087311 0.3161115 -3.640516 -2.026695 1.602262 0.08209633 0 0 0 0 0 0 0
0 -0.5007772 0.08134101 0.2829819 -1.461224 -0.3776309 0.9974514 0.08268239 0 0 0 0 0 0 0
0 7.824311 -3.364939 -0.6201194 18.64777 18.46831 -12.38868 0.08225344 0 0 0 0 0 0 0
0 -0.1580367 -0.03425165 0.2405968 -0.4761476 0.4184105 0.5927077 0.0823484 0 0 0 0 0 0 0
0 -0.1174036 -0.05303744 0.2370066 -0.3623033 0.5300971 0.5257813 0.08267547 0 0 0 0 0 0 0
0 -0.1510211 -0.03177711 0.239025 -0.507316 0.5091311 0.5708472 0.08254498 0 0 0 0 0 0 0
0 -0.09363023 -0.062745 0.2343885 -0.308171 0.5675172 0.4663177 0.08276327 0 0 0 0 0 0 0
0 -0.2163955 0.01870946 0.2603114 -0.7855511 0.4684996 0.6751761 0.08249915 0 0 0 0 0 0 0
0 -0.1038763 -0.05733481 0.2392218 -0.3442563 0.5483426 0.4954598 0.08274283 0 0 0 0 0 0 0
0 4.884635 -2.610827 -2.048761 19.49594 10.07039 -12.6823 0.0828306 0 0 0 0 0 0 0
0 1.493491 -1.360993 -0.1474752 5.830369 3.322788 -3.434165 0.08305603 0 0 0 0 0 0 0
0 2.053014 -1.755298 -0.1682839 7.6868 4.913341 -7.079555 0.08304123 0 0 0 0 0 0 0
0 -0.1127927 -0.04641378 0.2424452 -0.4523115 0.5050363 0.6409369 0.08393817 0 0 0 0 0 0 0
0 -0.07727398 -0.06968354 0.2332687 -0.2918569 0.5970092 0.4750448 0.08448164 0 0 0 0 0 0 0
0 -0.09138243 -0.03979645 0.2431964 -0.5098807 0.6304088 0.674526 0.08561094 0 0 0 0 0 0 0
0 2.080024 -2.416144 -0.5339521 8.26731 3.029932 -16.43523 0.08662733 0 0 0 0 0 0 0
0 -0.1794408 0.03598652 0.2533127 -0.6008067 0.5055644 0.8457098 0.0876481 0 0 0 0 0 0 0
0 -4.884676 3.472591 1.112376 -14.13003 -8.739405 -4.619568 0.0884242 0 0 0 0 0 0 0
0 -0.04564526 -0.0947238 0.2260347 -0.1238456 0.6428607 0.3584404 0.08991554 0 0 0 0 0 0 0
0 -0.04198572 -0.09774278 0.2253873 -0.110398 0.6491791 0.3478502 0.0904723 0 0 0 0 0 0 0
0 -0.03821158 -0.1007813 0.2245797 -0.09120931 0.6516401 0.3338909 0.09100076 0 0 0 0 0 0 0
0 -0.03483413 -0.1039844 0.2238736 -0.08178885 0.6548557 0.319773 0.09109664 0 0 0 0 0 0 0
0 -0.03209127 -0.1055592 0.2229309 -0.06702047 0.6565312 0.3200949 0.09059896 0 0 0 0 0 0 0
0 -0.02883792 -0.1098961 0.2223475 -0.05172127 0.6577764 0.3040946 0.09106697 0 0 0 0 0 0 0
0 -0.02659884 -0.1115717 0.2214286 -0.04072248 0.6596681 0.3052666 0.0909931 0 0 0 0 0 0 0
0 -0.02444122 -0.1144102 0.220472 -0.02953137 0.6596546 0.2936151 0.09087088 0 0 0 0 0 0 0
0 -0.02186655 -0.1175837 0.2195501 -0.01262171 0.6605854 0.2825761 0.09046932 0 0 0 0 0 0 0
0 -0.02023896 -0.1203985 0.218629 0.01096807 0.6579919 0.2776844 0.09133957 0 0 0 0 0 0 0
0 -0.01874083 -0.1225758 0.2181489 0.02065527 0.6585798 0.2709682 0.09224591 0 0 0 0 0 0 0
0 -0.01735269 -0.1251819 0.2178062 0.03757861 0.6569624 0.266443 0.09312364 0 0 0 0 0 0 0
0 -0.01605157 -0.1273062 0.2173256 0.0457043 0.657091 0.2610298 0.09332024 0 0 0 0 0 0 0
0 -0.01525384 -0.1288508 0.2169656 0.05475555 0.6550656 0.258172 0.09366709 0 0 0 0 0 0 0
0 -0.01485216 -0.1301993 0.2166365 0.06561368 0.6516966 0.2522469 0.09441142 0 0 0 0 0 0 0
0 -0.01433105 -0.1311865 0.2165426 0.06887333 0.6500438 0.2517504 0.09496588 0 0 0 0 0 0 0
0 -0.0139866 -0.1317043 0.2163795 0.07418775 0.6489725 0.2532264 0.09558455 0 0 0 0 0 0 0
0 -0.01387301 -0.1324276 0.2164894 0.07600226 0.6486269 0.2494548 0.09565923 0 0 0 0 0 0 0
0 -0.01380439 -0.1325804 0.2165944 0.07833751 0.6476792 0.2499641 0.09574085 0 0 0 0 0 0 0
0 -0.01387286 -0.1324017 0.2165864 0.07848237 0.647397 0.2500585 0.09570426 0 0 0 0 0 0 0
0 -0.01415252 -0.131922 0.2168721 0.07929029 0.6457989 0.2537275 0.09565542 0 0 0 0 0 0 0
0 -0.0146493 -0.1314707 0.2171297 0.07790499 0.6449762 0.2556102 0.09586161 0 0 0 0 0 0 0
0 -0.01512331 -0.130543 0.2173109 0.07427976 0.6459283 0.2586695 0.09597592 0 0 0 0 0 0 0
0 -0.01565831 -0.1293172 0.2174999 0.06610612 0.6485088 0.2592551 0.0959279 0 0 0 0 0 0 0
0 -0.01641868 -0.1281985 0.21799 0.05693324 0.6504998 0.2627078 0.09604981 0 0 0 0 0 0 0
0 -0.01704956 -0.1273332 0.2187461 0.04924519 0.6518276 0.2665619 0.09598096 0 0 0 0 0 0 0
0 -0.02019252 -0.1225871 0.2223246 0.03043628 0.6521262 0.2806359 0.09595912 0 0 0 0 0 0 0
0 -0.01813166 -0.1250305 0.2201866 0.03055711 0.6552181 0.2745168 0.0957124 0 0 0 0 0 0 0
0 -0.01999416 -0.1222012 0.2211719 0.01917349 0.6554472 0.2810425 0.09540024 0 0 0 0 0 0 0
0 -0.02091623 -0.1199365 0.2212968 0.004950028 0.6572767 0.2901132 0.09493361 0 0 0 0 0 0 0
0 -0.02284198 -0.1171593 0.2221877 -0.01259887 0.6584007 0.2947908 0.09318977 0 0 0 0 0 0 0
0 -0.02395978 -0.1149376 0.2225754 -0.03061689 0.6613328 0.2955357 0.09236759 0 0 0 0 0 0 0
0 -0.02579665 -0.1121204 0.2234088 -0.04467979 0.6601722 0.2999775 0.09158652 0 0 0 0 0 0 0
0 -0.02760907 -0.1095753 0.2240033 -0.05853304 0.658639 0.3093919 0.09192017 0 0 0 0 0 0 0
0 -0.03117868 -0.105892 0.2250207 -0.07671996 0.6550676 0.3225213 0.09158468 0 0 0 0 0 0 0
0 -0.03304021 -0.1037586 0.2254057 -0.08591457 0.6546608 0.3285954 0.0911625 0 0 0 0 0 0 0
0 -0.03765148 -0.1001295 0.22685 -0.1126162 0.6490199 0.3413525 0.09087979 0 0 0 0 0 0 0
0 -0.04037943 -0.09727788 0.2274132 -0.1249443 0.6466612 0.3531518 0.09016107 0 0 0 0 0 0 0
0 -0.0437277 -0.09422997 0.2280774 -0.1376893 0.6428328 0.365505 0.08964626 0 0 0 0 0 0 0
0 -0.04691751 -0.09174718 0.228711 -0.1561007 0.6399554 0.3754347 0.08915883 0 0 0 0 0 0 0
0 -0.05163237 -0.0881179 0.2293548 -0.1732724 0.6340775 0.395129 0.08864697 0 0 0 0 0 0 0
0 -0.05480289 -0.08532355 0.2297732 -0.1856653 0.6292882 0.4040007 0.08803707 0 0 0 0 0 0 0
0 -0.05873087 -0.0824604 0.2304576 -0.1931495 0.6224476 0.4159811 0.08736438 0 0 0 0 0 0 0
0 -0.06346313 -0.07963388 0.2310474 -0.2020651 0.6149277 0.4277336 0.08699947 0 0 0 0 0 0 0
0 -0.06686219 -0.07741262 0.2317946 -0.2147739 0.6100692 0.4322737 0.08635867 0 0 0 0 0 0 0
0 -0.07091934 -0.0745442 0.2325162 -0.2313574 0.604179 0.4423894 0.08583646 0 0 0 0 0 0 0
0 -0.07550082 -0.07153781 0.2330867 -0.2461479 0.5974922 0.4555088 0.08511019 0 0 0 0 0 0 0
0 -0.08031913 -0.06899942 0.2334427 -0.2658284 0.5893445 0.4610464 0.08460846 0 0 0 0 0 0 0
0 -0.08623539 -0.06583992 0.2336502 -0.2832173 0.5794433 0.4687857 0.08477596 0 0 0 0 0 0 0
0 -0.09055763 -0.06372835 0.234203 -0.2957767 0.5717503 0.4769201 0.08461989 0 0 0 0 0 0 0
0 -0.09441105 -0.06211596 0.2347763 -0.3089395 0.5632299 0.4828646 0.0842953 0 0 0 0 0 0 0
0 -0.09823536 -0.06083356 0.2354991 -0.3189791 0.5548603 0.4831462 0.08428641 0 0 0 0 0 0 0
0 -0.1018975 -0.05956697 0.2360086 -0.3261138 0.5474716 0.4877262 0.08428682 0 0 0 0 0 0 0
0 -0.1054562 -0.05816138 0.2365672 -0.3326775 0.5394136 0.4905083 0.08411444 0 0 0 0 0 0 0
0 -0.1086626 -0.05725398 0.2371302 -0.3420104 0.532621 0.4951942 0.08375506 0 0 0 0 0 0 0
0 -0.1118172 -0.05612937 0.2375975 -0.3525633 0.5252895 0.4975674 0.08330865 0 0 0 0 0 0 0
0 -0.1145978 -0.05516768 0.2379538 -0.3577714 0.5203583 0.5003477 0.08300424 0 0 0 0 0 0 0
0 -0.1167288 -0.05449292 0.2381916 -0.3608066 0.5172926 0.5040478 0.08331943 0 0 0 0 0 0 0
0 -0.1189769 -0.05359298 0.238447 -0.3641476 0.5130216 0.5072787 0.08328671 0 0 0 0 0 0 0
0 -0.1212147 -0.05259546 0.2387096 -0.3688586 0.5084707 0.5068381 0.08344208 0 0 0 0 0 0 0
0 -0.1228867 -0.05195558 0.2388039 -0.3702741 0.5050063 0.5090854 0.08358483 0 0 0 0 0 0 0
0 -0.1237556 -0.05175904 0.238908 -0.3751968 0.50268 0.5108932 0.08358651 0 0 0 0 0 0 0
0 -0.1242901 -0.05172145 0.2390302 -0.3741525 0.5015162 0.5119058 0.08336543 0 0 0 0 0 0 0
0 -0.1253116 -0.05121205 0.2390735 -0.3769591 0.499406 0.5104962 0.08320679 0 0 0 0 0 0 0
0 -0.1245862 -0.05152256 0.2388471 -0.3746431 0.5007657 0.5125081 0.08311491 0 0 0 0 0 0 0
0 -0.1246212 -0.0514632 0.238744 -0.3801626 0.5010566 0.5113398 0.08299287 0 0 0 0 0 0 0
0 -0.1240185 -0.05186657 0.2385956 -0.3771198 0.502821 0.509387 0.08320718 0 0 0 0 0 0 0
0 -0.1241134 -0.05159881 0.2386076 -0.376929 0.5017687 0.5134165 0.08335285 0 0 0 0 0 0 0
0 -0.1250196 -0.05128264 0.2388913 -0.3807615 0.5021564 0.50771 0.083557 0 0 0 0 0 0 0
0 -0.1238555 -0.05192329 0.2389316 -0.3808712 0.5017538 0.5095726 0.08365338 0 0 0 0 0 0 0
0 -0.1255395 -0.0515727 0.2396996 -0.3761286 0.4998038 0.5030227 0.0837222 0 0 0 0 0 0 0
0 -0.1242564 -0.05153223 0.2387031 -0.3857941 0.5023522 0.5032339 0.08361457 0 0 0 0 0 0 0
fileFormatVersion: 2
guid: cd6e7f3979fe7d040baa17c40e58d1b4
timeCreated: 1515945232
licenseType: Free
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment