Skip to content
New issue

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

why current_shapes[idx] = bboxes_[i].ReProject(bboxes_[k].Project(gt_shapes_[k])) ? #8

Open
xiaoxiongli opened this issue Dec 30, 2016 · 1 comment

Comments

@xiaoxiongli
Copy link

xiaoxiongli commented Dec 30, 2016

Dear luoyetx,
i am reading your code, and i find that in the trian.cpp, line 180, i can not understand why we do like this? one face's initial shape is initialize by another face?

int N = imgs_.size();
int L = N*config.initShape_n;
vector<Mat> imgs(L), gt_shapes(L), current_shapes(L);
vector<BBox> bboxes(L);
RNG rng(getTickCount());
for (int i = 0; i < N; i++) {
    for (int j = 0; j < config.initShape_n; j++) {
        int idx = i*config.initShape_n + j;
        int k = 0;
        do {
            //if (i < (N / 2)) k = rng.uniform(0, N / 2);
            //else k = rng.uniform(N / 2, N);
            k = rng.uniform(0, N);
        } while (k == i);
        imgs[idx] = imgs_[i];                               
        gt_shapes[idx] = gt_shapes_[i];
        bboxes[idx] = bboxes_[i];
        current_shapes[idx] = bboxes_[i].ReProject(bboxes_[k].Project(gt_shapes_[k])); <----line 180
    }
}
@xiaoxiongli xiaoxiongli changed the title why we omit some of the images? why current_shapes[idx] = bboxes_[i].ReProject(bboxes_[k].Project(gt_shapes_[k])) ? Dec 30, 2016
@luoyetx
Copy link
Owner

luoyetx commented Dec 30, 2016

You can init the shape with mean shape. If you want a data augment, you can also random shift the init shape. Init the shape using other face's ground truth shape is some like data augment if you use multi shapes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants