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

Refactor the Facial Landmark Detection example to fetch in parallel #188

Merged

Conversation

reillyeon
Copy link
Contributor

This model separates each constant value into a separate NumPy file which needs to be fetched. This change refactors the graph construction so that these fetches can happen in parallel rather than waiting for each fetch to complete before building that graph layer.

This is an experiment to determine whether it would be more ergonomic for the graph builder functions to accept promises so that this kind of code can be written without the careful placement of awaits demonstrated here.

This model separates each constant value into a separate NumPy file
which needs to be fetched. This change refactors the graph construction
so that these fetches can happen in parallel rather than waiting for
each fetch to complete before building that graph layer.

This is an experiment to determine whether it would be more ergonomic
for the graph builder function to accept promises so that this kind of
code can be written without the careful placement of awaits demonstrated
here.
@reillyeon
Copy link
Contributor Author

@huningxin, @BruceDai, @Honry, please take a look.

Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this optimization!

Copy link
Collaborator

@Honry Honry left a comment

Choose a reason for hiding this comment

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

LGTM % nits complained by lint. Thanks for the optimization! @reillyeon, Are you going to optimize the rest samples? If no, I can do that. :)

@reillyeon
Copy link
Contributor Author

I've fixed the lint errors. Can you merge this change and then take a look at the rest of the samples?

@Honry Honry merged commit 27039b3 into webmachinelearning:master Nov 14, 2023
3 checks passed
@reillyeon reillyeon deleted the parallel_face_landmark_load branch November 14, 2023 23:06
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.

3 participants