コード例 #1
0
        public TestCollection(string filename)
        {
            TrainDataFileReader reader = new TrainDataFileReader(filename, false);

            _faceCollections = new Dictionary <int, FaceCollection>();
            _allFaces        = new List <Face>();


            int faceId = 0;

            foreach (TrainDataSample sample in reader)
            {
                int            id         = (int)sample.Targets[0];
                FaceCollection collection = null;

                if (_faceCollections.ContainsKey(id))
                {
                    collection = _faceCollections[id];
                }
                else
                {
                    collection = new FaceCollection(id);
                    _faceCollections.Add(id, collection);
                }

                Face face = collection.Add(sample, id, faceId);
                _allFaces.Add(face);
                ++faceId;
            }
        }
コード例 #2
0
 public Face(FaceCollection parent, LiveLabs.TrainDataSample data, int id)
 {
     _parent = parent;
     _data   = data;
     _id     = id;
 }