-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
fluid/face_detection/infer.py
Outdated
|
||
def detect_face(image, image_shape, raw_image, shrink): |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fluid/face_detection/infer.py
Outdated
#fluid.io.load_vars(exe, args.model_dir, predicate=if_exist) | ||
|
||
detection, = exe.run(infer_program, | ||
feed=feeder.feed([img]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feed={'image': img}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fluid/face_detection/infer.py
Outdated
feed=feeder.feed([img]), | ||
fetch_list=fetches, | ||
return_numpy=False) | ||
detection = np.array(detection) |
There was a problem hiding this comment.
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.
fluid/face_detection/infer.py
Outdated
img = np.array(img) | ||
|
||
scope = fluid.core.Scope() | ||
model_program = fluid.Program() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model_program -> main_program
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fluid/face_detection/infer.py
Outdated
num_classes, | ||
sub_network=args.use_pyramidbox, | ||
is_infer=True) | ||
infer_program, nmsed_out = network.infer() |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this 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.
Fix Multi-scale testing for PyramidBox model. #995
Fix Add Pyramidbox inference configure. #993