Skip to content

Conversation

baiyfbupt
Copy link
Contributor

@baiyfbupt baiyfbupt commented Jun 13, 2018

@baiyfbupt baiyfbupt requested a review from qingqing01 June 13, 2018 05:16
@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
infer_program, nmsed_out = network.infer()
fetches = [nmsed_out]

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.

2 participants