我正在使用 helen数据集训练 DLIB shape_predictor 194个面部地标,用于通过{检测面部地标dlib库的{1}}。
现在它给了我一个约{strong> 45 MB 的 int SaveChangesWithDelete(int userId)
{
using (var tx= Database.BeginTransaction()) //Begin a new transaction
{
var entitiyGroups = ChangeTracker.Entries()
.Where(e => e.State == EntityState.Deleted && e.Entity is Auditable)
.Select(e => e.Entity)
.GroupBy(d => d.GetType();
foreach (var entityGroup in entitiyGroups) //Loop through deleted entities and run a manual UPDATE
{
string query = string.Format(@"
UPDATE {0} SET UpdatedBy = {1}
WHERE Id IN ({2})
", entityGroup.Key.Name, userId, string.Join(",", entityGroup.Select(e => PrimaryKeyValue(e))));
Database.ExecuteSqlCommand(query); //Execute the query - this triggers the audit framework
}
int result = SaveChanges(); //save the context changes as normal
tx.Commit(); //commit the transaction
return result; //return the result
}
}
二进制文件,与68个面部地标的给定文件(http://sourceforge.net/projects/dclib/files/dlib/v18.10/shape_predictor_68_face_landmarks.dat.bz2)相比较少。在培训中
当我使用经过训练的数据获得面部地标位置时,IN结果我得到了..
与68个地标的结果非常不同
68具有里程碑意义的形象:
为什么?
答案 0 :(得分:7)
好的,好像你还没看过code评论(?):
shape_predictor_trainer trainer;
// This algorithm has a bunch of parameters you can mess with. The
// documentation for the shape_predictor_trainer explains all of them.
// You should also read Kazemi's paper which explains all the parameters
// in great detail. However, here I'm just setting three of them
// differently than their default values. I'm doing this because we
// have a very small dataset. In particular, setting the oversampling
// to a high amount (300) effectively boosts the training set size, so
// that helps this example.
trainer.set_oversampling_amount(300);
// I'm also reducing the capacity of the model by explicitly increasing
// the regularization (making nu smaller) and by using trees with
// smaller depths.
trainer.set_nu(0.05);
trainer.set_tree_depth(2);
查看Kazemi paper,ctrl-f字符串'参数'并阅读...