Skip to content

Commit bf73164

Browse files
committed
Resolve comments.
1 parent f1f3d2e commit bf73164

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

keras_hub/src/models/depth_anything/depth_anything_backbone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class DepthAnythingBackbone(Backbone):
5858
input_data = {
5959
"images": np.ones(shape=(1, 518, 518, 3), dtype="float32"),
6060
}
61-
model = keras_hub.models.DINOV2Backbone.from_preset(
61+
model = keras_hub.models.DepthAnythingBackbone.from_preset(
6262
"depth_anything_v2_small"
6363
)
6464
model(input_data)
@@ -67,7 +67,7 @@ class DepthAnythingBackbone(Backbone):
6767
input_data = {
6868
"images": np.ones(shape=(1, 224, 224, 3), dtype="float32"),
6969
}
70-
model = keras_hub.models.DINOV2Backbone.from_preset(
70+
model = keras_hub.models.DepthAnythingBackbone.from_preset(
7171
"depth_anything_v2_small", image_shape=(224, 224, 3)
7272
)
7373
model(input_data)

keras_hub/src/models/dinov2/dinov2_layers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,16 @@ def get_config(self):
277277
)
278278
return config
279279

280-
def compute_output_shape(self, inputs_shape):
281-
output_shape = [inputs_shape[0], None, self.hidden_dim]
280+
def compute_output_shape(self, input_shape):
281+
output_shape = [input_shape[0], None, self.hidden_dim]
282282
if self.data_format == "channels_last":
283-
if inputs_shape[1] is not None and inputs_shape[2] is not None:
284-
patch_num = inputs_shape[1] // self.patch_size
283+
if input_shape[1] is not None and input_shape[2] is not None:
284+
patch_num = input_shape[1] // self.patch_size
285285
# 1 is for cls token.
286286
output_shape[1] = 1 + self.num_register_tokens + patch_num**2
287287
else:
288-
if inputs_shape[2] is not None and inputs_shape[3] is not None:
289-
patch_num = inputs_shape[2] // self.patch_size
288+
if input_shape[2] is not None and input_shape[3] is not None:
289+
patch_num = input_shape[2] // self.patch_size
290290
# 1 is for cls token.
291291
output_shape[1] = 1 + self.num_register_tokens + patch_num**2
292292
return output_shape

0 commit comments

Comments
 (0)