InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

Depth Anything V2

Open blessedcoolant opened this issue 1 year ago • 4 comments

  • Updated the previous DepthAnything manual implementation to use the transformers implementation instead. So we can get upstream features.
  • Plugged in the DepthAnything models to be handled by Invoke's Model Manager.
  • small_v2 model will use DepthAnythingV2. This has been added as a new model option and is now also the default in the Linear UI.

opera_TxRhmbFole

Merge

Review and merge.

blessedcoolant avatar Jul 25 '24 08:07 blessedcoolant

Did we consider just using the transformers implementation (https://huggingface.co/docs/transformers/v4.43.3/en/model_doc/depth_anything_v2)? Is there a reason that we are choosing to maintain a copy of the model source?

RyanJDick avatar Jul 26 '24 20:07 RyanJDick

Did we consider just using the transformers implementation (https://huggingface.co/docs/transformers/v4.43.3/en/model_doc/depth_anything_v2)? Is there a reason that we are choosing to maintain a copy of the model source?

Did not consider coz .. well I didn't know it was implemented there. Easier to do it this way but one advantage of keeping the source might be to make changes as we need if further iterations of the model releases. But I think it should be fine either way.

blessedcoolant avatar Jul 26 '24 20:07 blessedcoolant

Did not consider coz .. well I didn't know it was implemented there. Easier to do it this way but one advantage of keeping the source might be to make changes as we need if further iterations of the model releases. But I think it should be fine either way.

My preference would be to just import the implementation if we are not doing anything custom. That way we get upstream improvements / bugfixes for free.

RyanJDick avatar Jul 26 '24 20:07 RyanJDick

Did not consider coz .. well I didn't know it was implemented there. Easier to do it this way but one advantage of keeping the source might be to make changes as we need if further iterations of the model releases. But I think it should be fine either way.

My preference would be to just import the implementation if we are not doing anything custom. That way we get upstream improvements / bugfixes for free.

Agreed. I updated the entire DepthAnything application to now use the transformers implementation. The small model uses DepthAnything V2 while the base and large models use the original DepthAnything V1 models due to license restrictions.

blessedcoolant avatar Jul 30 '24 19:07 blessedcoolant