Skip to content

Commit

Permalink
fix two problems with scd doesn't resume properly
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliu committed Nov 30, 2014
1 parent 5b3087f commit 2ccc840
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/scdcreate.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int main(int argc, char** argv)
.hit_rate = 0.9925,
.false_positive_rate = 1e-8,
.auc_crit = 1e-5,
.maximum_feature = 256,
.maximum_feature = 1024,
.light_stage = 3,
.light_feature = 4,
},
Expand Down
5 changes: 4 additions & 1 deletion lib/ccv_scd.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,9 @@ static void _ccv_scd_classifier_cascade_new_function_state_read(const char* file
size = sqlite3_column_bytes(function_state_stmt, 8);
const void* pw = sqlite3_column_blob(function_state_stmt, 8);
memcpy(z->pw, pw, size);
size = sqlite3_column_bytes(function_state_stmt, 9);
const void* nw = sqlite3_column_blob(function_state_stmt, 9);
memcpy(z->nw, nw, size);
}
sqlite3_finalize(function_state_stmt);
}
Expand Down Expand Up @@ -908,6 +911,7 @@ ccv_scd_classifier_cascade_t* ccv_scd_classifier_cascade_new(ccv_array_t* posfil
memset(z.s, 0, sizeof(double) * (z.positives->rnum + z.negatives->rnum));
z.cascade->classifiers = (ccv_scd_classifier_t*)ccrealloc(z.cascade->classifiers, sizeof(ccv_scd_classifier_t) * (z.t + 1));
ccv_scd_classifier_t* classifier = z.cascade->classifiers + z.t;
z.cascade->count = z.t + 1;
classifier->threshold = 0;
classifier->features = 0;
classifier->count = 0;
Expand Down Expand Up @@ -1016,7 +1020,6 @@ ccv_scd_classifier_cascade_t* ccv_scd_classifier_cascade_new(ccv_array_t* posfil
z.accu_true_positive_rate *= true_positive_rate;
z.accu_false_positive_rate *= false_positive_rate;
PRINT(CCV_CLI_INFO, " - %d-th stage classifier TP rate : %f, FP rate : %f, ATP rate : %lf, AFP rate : %lg, at threshold : %f\n", z.t + 1, true_positive_rate, false_positive_rate, z.accu_true_positive_rate, z.accu_false_positive_rate, classifier->threshold);
z.cascade->count = z.t + 1;
if (z.accu_false_positive_rate < params.stop_criteria.false_positive_rate)
break;
if (z.t < params.boosting - 1)
Expand Down

0 comments on commit 2ccc840

Please sign in to comment.