[feat]: Adding Offline Support for Interactive Web Demo #215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description 🤔
This update aims to provide 100% offline support for the Interactive Web Demo (ATM Playground) that demonstrates touchless interactions using the MediaPipe Machine Learning Library.
Advantages 🚀
If precaching is enabled, the app will work offline after the first load. 🎉
Caching assets with a service worker can speed up repeat visits and provide offline support. Workbox makes this easy and is included in React App by default. Feel free to explore this guide to know more!
Additionally, a few other optimizations include updates to Kernel, minor UI bug fixing & adding LICENSE header to
index.html
.🔸 Parent Repo → @Neilblaze/GSOC-23
🔸 Live Demo → Here
cc: @jenperson
Testing
To test the changes, open the live demo on your browser. If you're accessing it for the first time, it might take some time to load the model & assets on your local (depending on your internet speed). Once it's loaded, feel free to explore and interact with the demo. Disconnect the internet and then perform a refresh (or press F5); it should still load and work even in offline mode!
To extend it further, open DevTools by pressing
Control+Shift+J
orCommand+Option+J
(Mac). TheConsole
panel opens. Then click on theNetwork
tab, which will open the Network panel. Click onNo Throttling
& uncheck theDisable Cache
to make sure the cached data is accessible & then perform a normal refresh to make it run while offline. If you want to compare different trials, you can use the profiler to capture the waterfall. The mean result of these trials can be found above.6.1s
from16.8s
, i.e.275%
(after 1st load) 📈Checklist
Please ensure the following items are complete before submitting a pull request:
Type of Change
Please check the relevant option below: