Skip to content

initial depth anything module implementation#1597

Draft
leshy wants to merge 1 commit intodevfrom
feat/depth_anything3
Draft

initial depth anything module implementation#1597
leshy wants to merge 1 commit intodevfrom
feat/depth_anything3

Conversation

@leshy
Copy link
Copy Markdown
Contributor

@leshy leshy commented Mar 17, 2026

No description provided.

@Kaweees
Copy link
Copy Markdown
Member

Kaweees commented Mar 22, 2026

This will be really useful for #1434, might be the nav stack needed for the Booster series

return super().stop() # type: ignore[no-any-return]


def deploy(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably delete

color_image: In[Image]

depth_image: Out[Image]
confidence: Out[Image]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd recommend rename to depth_confidence for the sake of other modules.

if self.config.mode == DA3Mode.MULTI:
for i in range(1, self.config.num_cameras):
setattr(self, f"color_image_{i}", In(Image, f"color_image_{i}", self))
setattr(self, f"depth_image_{i}", Out(Image, f"depth_image_{i}", self))
Copy link
Copy Markdown
Member

@jeff-hykin jeff-hykin Mar 31, 2026

Choose a reason for hiding this comment

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

I'd just leave this module to 1 camera and then lets create a general fix for multi-things rather than a module-specific multi hack. For drones we're going to need to solve the multi-agent thing pretty soon.

Copy link
Copy Markdown
Member

@jeff-hykin jeff-hykin Mar 31, 2026

Choose a reason for hiding this comment

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

I understand it's better to instantiate the model once and then use batching, but the general problem of 'many modules/streams need to use < same object >' is a general problem: ex control coordinator modules sharing an event loop thread and/or network connection object

publish_confidence: bool = False


class DepthAnything3Module(Module[Config]):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A docstring explaining single/multi/temporal would be nice.

)

@simple_mcache
def _single_stream(self) -> Observable[tuple[Image, np.ndarray, np.ndarray]]:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure why this is a method (compared to the much large multi-case being inlined) I don't see the cache benefit of a function that's only ever called once

@jeff-hykin
Copy link
Copy Markdown
Member

Would be nice if Paul could use this in his security demo, great reusable module.

@jeff-hykin
Copy link
Copy Markdown
Member

@greptile are the models auto-downloaded as needed?

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 31, 2026

Yes, the models are auto-downloaded. The implementation uses DepthAnything3.from_pretrained() in the __init__ method (line 85), which follows the standard HuggingFace pattern - it automatically downloads models from the model hub on first use and caches them locally for subsequent runs.

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