Ejemplo n.º 1
0
            public static FaceFeaturesDB ReadCSV(string filename, string delim = ",")
            {
                var db = new FaceFeaturesDB();

                using (var csvreader = new CsvReader(new StreamReader(filename), true))
                {
                    var headers = csvreader.GetFieldHeaders();
                    while (csvreader.ReadNextRecord())
                    {
                        var metdata  = PhotoMetadataCsv.Deserializer(filename, csvreader);
                        var features = new FaceFeatures(
                            new ComponentFeature(ParseEscapedVector(csvreader[3]), 0),
                            new ComponentFeature(ParseEscapedVector(csvreader[4]), 0),
                            new ComponentFeature(ParseEscapedVector(csvreader[5]), 0),
                            new ComponentFeature(ParseEscapedVector(csvreader[6]), 0),
                            new ComponentFeature(ParseEscapedVector(csvreader[7]), 0),
                            ParseEscapedVector(csvreader[8])
                            );
                        db.AddPhotoFeatures(metdata, features);
                    }
                }
                return(db);
            }
Ejemplo n.º 2
0
 public void AddPhotoFeatures(PhotoMetadata photo, FaceFeatures features)
 {
     memoryDb[photo] = features;
 }