使用背景类进行对象检测

时间:2019-09-26 13:11:29

标签: python tensorflow object-detection

我需要使用后台类获取对象检测的输出 我正在使用基于更快的RCNN 101的冻结模型(.pb)

我知道您需要对.pb模型文件进行推断的哪几层才能获得没有背景的输出 例如:

void drawCylinder(float pHeight, std::vector<float> center1, std::vector<float> center2) {

    const GLfloat* projection = glm::value_ptr(glm::perspective(glm::radians(fov), (float)WIN_WIDTH / (float)WIN_HEIGHT, 0.1f, 100.0f));
    const GLfloat* view = glm::value_ptr(camera.GetViewMatrix());

    glm::vec3 diff = glm::vec3(center2[0] - center1[0], center2[1] - center1[1], center2[2] - center1[2]);
    float distance = sqrt(pow(center2[0] - center1[0], 2) + pow(center2[1] - center1[1], 2) + pow(center2[2] - center1[2], 2));

    glUseProgram(0);

    glPushMatrix();
    glMatrixMode(GL_PROJECTION);
    glLoadMatrixf(projection);

    glPushMatrix();
    glMatrixMode(GL_MODELVIEW);
    glLoadMatrixf(view);

    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    glColor3f(1.0f, 1.0f, 0.0f);
    glTranslated(center1[0] - 12.25f, (center1[1]) + 0.0f, (center1[2]) - 12.25f);
    // Here I should perform the rotation in order to draw the cylinder in the right position
    gluCylinder(quadric, 0.1f, 0.1f, pHeight, 32, 32);
    glPopMatrix();

    glMatrixMode(GL_PROJECTION);
    glPopMatrix();

}

是否可以使用后台类获取输出?

0 个答案:

没有答案