mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Some fixes
This commit is contained in:
@ -84,7 +84,7 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i
|
|||||||
args.num_boxes = l.max_boxes;
|
args.num_boxes = l.max_boxes;
|
||||||
args.d = &buffer;
|
args.d = &buffer;
|
||||||
args.type = DETECTION_DATA;
|
args.type = DETECTION_DATA;
|
||||||
args.threads = 8;
|
args.threads = 4;// 8;
|
||||||
|
|
||||||
args.angle = net.angle;
|
args.angle = net.angle;
|
||||||
args.exposure = net.exposure;
|
args.exposure = net.exposure;
|
||||||
|
@ -50,6 +50,7 @@ float get_current_rate(network net)
|
|||||||
int batch_num = get_current_batch(net);
|
int batch_num = get_current_batch(net);
|
||||||
int i;
|
int i;
|
||||||
float rate;
|
float rate;
|
||||||
|
if (batch_num < net.burn_in) return net.learning_rate * pow((float)batch_num / net.burn_in, net.power);
|
||||||
switch (net.policy) {
|
switch (net.policy) {
|
||||||
case CONSTANT:
|
case CONSTANT:
|
||||||
return net.learning_rate;
|
return net.learning_rate;
|
||||||
@ -66,8 +67,9 @@ float get_current_rate(network net)
|
|||||||
case EXP:
|
case EXP:
|
||||||
return net.learning_rate * pow(net.gamma, batch_num);
|
return net.learning_rate * pow(net.gamma, batch_num);
|
||||||
case POLY:
|
case POLY:
|
||||||
if (batch_num < net.burn_in) return net.learning_rate * pow((float)batch_num / net.burn_in, net.power);
|
return net.learning_rate * pow(1 - (float)batch_num / net.max_batches, net.power);
|
||||||
return net.learning_rate * pow(1 - (float)batch_num / net.max_batches, net.power);
|
//if (batch_num < net.burn_in) return net.learning_rate * pow((float)batch_num / net.burn_in, net.power);
|
||||||
|
//return net.learning_rate * pow(1 - (float)batch_num / net.max_batches, net.power);
|
||||||
case RANDOM:
|
case RANDOM:
|
||||||
return net.learning_rate * pow(rand_uniform(0,1), net.power);
|
return net.learning_rate * pow(rand_uniform(0,1), net.power);
|
||||||
case SIG:
|
case SIG:
|
||||||
|
@ -532,6 +532,7 @@ void parse_net_options(list *options, network *net)
|
|||||||
net->saturation = option_find_float_quiet(options, "saturation", 1);
|
net->saturation = option_find_float_quiet(options, "saturation", 1);
|
||||||
net->exposure = option_find_float_quiet(options, "exposure", 1);
|
net->exposure = option_find_float_quiet(options, "exposure", 1);
|
||||||
net->hue = option_find_float_quiet(options, "hue", 0);
|
net->hue = option_find_float_quiet(options, "hue", 0);
|
||||||
|
net->power = option_find_float_quiet(options, "power", 4);
|
||||||
|
|
||||||
if(!net->inputs && !(net->h && net->w && net->c)) error("No input parameters supplied");
|
if(!net->inputs && !(net->h && net->w && net->c)) error("No input parameters supplied");
|
||||||
|
|
||||||
@ -571,7 +572,7 @@ void parse_net_options(list *options, network *net)
|
|||||||
net->gamma = option_find_float(options, "gamma", 1);
|
net->gamma = option_find_float(options, "gamma", 1);
|
||||||
net->step = option_find_int(options, "step", 1);
|
net->step = option_find_int(options, "step", 1);
|
||||||
} else if (net->policy == POLY || net->policy == RANDOM){
|
} else if (net->policy == POLY || net->policy == RANDOM){
|
||||||
net->power = option_find_float(options, "power", 1);
|
//net->power = option_find_float(options, "power", 1);
|
||||||
}
|
}
|
||||||
net->max_batches = option_find_int(options, "max_batches", 0);
|
net->max_batches = option_find_int(options, "max_batches", 0);
|
||||||
}
|
}
|
||||||
|
@ -233,8 +233,9 @@ public:
|
|||||||
|
|
||||||
update_cur_bbox_vec(_cur_bbox_vec);
|
update_cur_bbox_vec(_cur_bbox_vec);
|
||||||
|
|
||||||
|
//src_grey_gpu.upload(src_mat, stream); // use BGR
|
||||||
src_mat_gpu.upload(src_mat, stream);
|
src_mat_gpu.upload(src_mat, stream);
|
||||||
cv::cuda::cvtColor(src_mat_gpu, src_grey_gpu, CV_BGR2GRAY, 0, stream);
|
cv::cuda::cvtColor(src_mat_gpu, src_grey_gpu, CV_BGR2GRAY, 1, stream);
|
||||||
}
|
}
|
||||||
if (old_gpu_id != gpu_id)
|
if (old_gpu_id != gpu_id)
|
||||||
cv::cuda::setDevice(old_gpu_id);
|
cv::cuda::setDevice(old_gpu_id);
|
||||||
@ -257,9 +258,9 @@ public:
|
|||||||
dst_grey_gpu = cv::cuda::GpuMat(dst_mat.size(), CV_8UC1);
|
dst_grey_gpu = cv::cuda::GpuMat(dst_mat.size(), CV_8UC1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//dst_grey_gpu.upload(dst_mat, stream); // use BGR
|
||||||
dst_mat_gpu.upload(dst_mat, stream);
|
dst_mat_gpu.upload(dst_mat, stream);
|
||||||
|
cv::cuda::cvtColor(dst_mat_gpu, dst_grey_gpu, CV_BGR2GRAY, 1, stream);
|
||||||
cv::cuda::cvtColor(dst_mat_gpu, dst_grey_gpu, CV_BGR2GRAY, 0, stream);
|
|
||||||
|
|
||||||
if (src_grey_gpu.rows != dst_grey_gpu.rows || src_grey_gpu.cols != dst_grey_gpu.cols) {
|
if (src_grey_gpu.rows != dst_grey_gpu.rows || src_grey_gpu.cols != dst_grey_gpu.cols) {
|
||||||
stream.waitForCompletion();
|
stream.waitForCompletion();
|
||||||
|
Reference in New Issue
Block a user