Draft
Conversation
Load transformers by injecting a script to the html head. Implement transformers into the estimateStart mode. Single frame estimation not yet supported. Also, some refactoring to keep code organized is still needed
Expanded the functionality to encompass single image depth estimation as well. This would all benefit from a refactoring, to keep code as clean and reused as possible, without repetition.
Reorganizing to have two separate classes
Organizing to keep both depth estimation classes separate
Reintroduces depth estimation using transformers but now refactored as a separate class. Still missing some features related to parameters that are currently accepted, like dilation factor
Removed remnants from the tensorflow class, added a utils folder with methods and variables used by both classes, and tested the module\'s features
Contributor
Author
|
For ease of use, here are two examples on the p5 web editor using a build of this code: You can swap back to the tensorflow depth estimation on these examples by replacing this: depthEstimator = await ml5.depthEstimation('depth-anything-v2-small');with this: depthEstimator = await ml5.depthEstimation();This build lacks automatic detection of the best |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements the depth-anything-v2-small model in ml5 using transformers.js. This current draft does the following:
With this in mind, the pending tasks are:
deviceanddtypefor the current browser, and set those automatically.onnxruntimeconsole warnings (mentioned here Add Transformer.js as a backend for image classification #289 (comment) and here [Question] How to stop warning log huggingface/transformers.js#270)transformersLoaderscript with the bundled transformers.js