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

Refine Pyramidbox infer and Pyramidbox configure #986

Merged
merged 4 commits into from
Jun 20, 2018
Merged

Refine Pyramidbox infer and Pyramidbox configure #986

merged 4 commits into from
Jun 20, 2018

Conversation

baiyfbupt
Copy link
Contributor

@baiyfbupt baiyfbupt commented Jun 13, 2018

@baiyfbupt baiyfbupt changed the title Refine infer.py to infer entire val set in face detection [WIP]Refine infer.py to infer entire val set in face detection Jun 13, 2018
@baiyfbupt baiyfbupt changed the title [WIP]Refine infer.py to infer entire val set in face detection Refine infer.py to infer entire val set in face detection Jun 20, 2018

def detect_face(image, image_shape, raw_image, shrink):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image_shape can get from image ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

[104., 117., 123.])[:, np.newaxis, np.newaxis].astype('float32')
img = img * 0.007843
img = [img]
img = np.array(img)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put above image preprocess to another function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

#fluid.io.load_vars(exe, args.model_dir, predicate=if_exist)

detection, = exe.run(infer_program,
feed=feeder.feed([img]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feed={'image': img}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

feed=feeder.feed([img]),
fetch_list=fetches,
return_numpy=False)
detection = np.array(detection)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line 170 and line 171.

img = np.array(img)

scope = fluid.core.Scope()
model_program = fluid.Program()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model_program -> main_program

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

num_classes,
sub_network=args.use_pyramidbox,
is_infer=True)
infer_program, nmsed_out = network.infer()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

infer_program, nmsed_out = network.infer(main_program)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

@qingqing01 qingqing01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Only build Program once will add in the future.

@baiyfbupt baiyfbupt changed the title Refine infer.py to infer entire val set in face detection Refine pyramidbox infer and Pyramidbox configure Jun 20, 2018
@baiyfbupt baiyfbupt changed the title Refine pyramidbox infer and Pyramidbox configure Refine Pyramidbox infer and Pyramidbox configure Jun 20, 2018
@baiyfbupt baiyfbupt merged commit 7ac5b3c into PaddlePaddle:develop Jun 20, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants