Skip to content

Commit 36368bb

Browse files
cosmo3769yuvraj-wale
authored andcommitted
[Yolov8 detector] Fix example in docstring (keras-team#2082)
* fix example in docstring * review comments
1 parent 81ed5a7 commit 36368bb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

keras_cv/models/object_detection/yolo_v8/yolo_v8_detector.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,22 +353,23 @@ class YOLOV8Detector(Task):
353353
```python
354354
images = tf.ones(shape=(1, 512, 512, 3))
355355
labels = {
356-
"boxes": [
356+
"boxes": tf.constant([
357357
[
358358
[0, 0, 100, 100],
359359
[100, 100, 200, 200],
360360
[300, 300, 100, 100],
361361
]
362-
],
363-
"classes": [[1, 1, 1]],
362+
], dtype=tf.float32),
363+
"classes": tf.constant([[1, 1, 1]], dtype=tf.int64),
364364
}
365+
365366
model = keras_cv.models.YOLOV8Detector(
366367
num_classes=20,
367368
bounding_box_format="xywh",
368369
backbone=keras_cv.models.YOLOV8Backbone.from_preset(
369-
"yolo_v8_m_coco"
370+
"yolo_v8_m_backbone_coco"
370371
),
371-
fpn_depth=2.
372+
fpn_depth=2
372373
)
373374
374375
# Evaluate model without box decoding and NMS

0 commit comments

Comments
 (0)