We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
void DecodeBBoxesWithPrior(const Dtype* bbox_data, const vector prior_bboxes, const int bbox_dim, const Dtype* means, const Dtype* stds, Dtype* pred_data) { const int num = prior_bboxes.size(); const int cls_num = bbox_dim/4; for (int i = 0; i < num; i++) { Dtype pw, ph, cx, cy; pw = prior_bboxes[i].xmax-prior_bboxes[i].xmin+1; ph = prior_bboxes[i].ymax-prior_bboxes[i].ymin+1; cx = 0.5*(prior_bboxes[i].xmax+prior_bboxes[i].xmin); cy = 0.5*(prior_bboxes[i].ymax+prior_bboxes[i].ymin); for (int c = 0; c < cls_num; c++) { Dtype bx, by, bw, bh; // bbox de-normalization bx = bbox_data[ibbox_dim+4c]stds[0]+means[0]; by = bbox_data[ibbox_dim+4c+1]stds[1]+means[1]; bw = bbox_data[ibbox_dim+4c+2]stds[2]+means[2]; bh = bbox_data[ibbox_dim+4*c+3]*stds[3]+means[3];
Dtype tx, ty, tw, th; tx = bx*pw+cx; ty = by*ph+cy; tw = pw*exp(bw); th = ph*exp(bh); tx -= (tw-1)/2; ty -= (th-1)/2; pred_data[i*bbox_dim+4*c] = tx; pred_data[i*bbox_dim+4*c+1] = ty; pred_data[i*bbox_dim+4*c+2] = tx+tw-1; pred_data[i*bbox_dim+4*c+3] = ty+th-1; }
} } What function does this part of the code implement?
The text was updated successfully, but these errors were encountered:
It codes the bounding box regression from prior boxes. It has no difference from the bounding box regression in Fasr/er R-CNN.
Sorry, something went wrong.
No branches or pull requests
void DecodeBBoxesWithPrior(const Dtype* bbox_data, const vector prior_bboxes,
const int bbox_dim, const Dtype* means, const Dtype* stds,
Dtype* pred_data) {
const int num = prior_bboxes.size();
const int cls_num = bbox_dim/4;
for (int i = 0; i < num; i++) {
Dtype pw, ph, cx, cy;
pw = prior_bboxes[i].xmax-prior_bboxes[i].xmin+1;
ph = prior_bboxes[i].ymax-prior_bboxes[i].ymin+1;
cx = 0.5*(prior_bboxes[i].xmax+prior_bboxes[i].xmin);
cy = 0.5*(prior_bboxes[i].ymax+prior_bboxes[i].ymin);
for (int c = 0; c < cls_num; c++) {
Dtype bx, by, bw, bh;
// bbox de-normalization
bx = bbox_data[ibbox_dim+4c]stds[0]+means[0];
by = bbox_data[ibbox_dim+4c+1]stds[1]+means[1];
bw = bbox_data[ibbox_dim+4c+2]stds[2]+means[2];
bh = bbox_data[ibbox_dim+4*c+3]*stds[3]+means[3];
}
}
What function does this part of the code implement?
The text was updated successfully, but these errors were encountered: