Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YOLOV8 instance segmentation model using YOLACT #2474

Merged
merged 12 commits into from
Sep 17, 2024
8 changes: 5 additions & 3 deletions .kokoro/github/ubuntu/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ then
keras_cv/src/models/object_detection_3d \
keras_cv/src/models/segmentation \
keras_cv/src/models/feature_extractor/clip \
keras_cv/src/models/stable_diffusion
keras_cv/src/models/stable_diffusion \
keras_cv/src/models/segmentation/yolo_v8_segmentation
else
pytest --cache-clear --check_gpu --run_large --durations 0 \
keras_cv/src/bounding_box \
Expand All @@ -85,5 +86,6 @@ else
keras_cv/src/models/object_detection_3d \
keras_cv/src/models/segmentation \
keras_cv/src/models/feature_extractor/clip \
keras_cv/src/models/stable_diffusion
fi
keras_cv/src/models/stable_diffusion \
keras_cv/src/models/segmentation/yolo_v8_segmentation
fi
3 changes: 3 additions & 0 deletions keras_cv/api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@
from keras_cv.src.models.segmentation.segment_anything.sam_transformer import (
TwoWayTransformer,
)
from keras_cv.src.models.segmentation.yolo_v8_segmentation.yolo_v8_segmentation import (
YOLOV8Segmentation,
)
from keras_cv.src.models.stable_diffusion.stable_diffusion import (
StableDiffusion,
)
Expand Down
3 changes: 3 additions & 0 deletions keras_cv/api/models/segmentation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@
from keras_cv.src.models.segmentation.segment_anything.sam import (
SegmentAnythingModel,
)
from keras_cv.src.models.segmentation.yolo_v8_segmentation.yolo_v8_segmentation import (
YOLOV8Segmentation,
)
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def call(
image_shape=image_shape,
)
bounding_boxes = {
"idx": idx,
"boxes": box_prediction,
"confidence": confidence_prediction,
"classes": ops.argmax(class_prediction, axis=-1),
Expand Down
1 change: 1 addition & 0 deletions keras_cv/src/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
from keras_cv.src.models.segmentation import SAMPromptEncoder
from keras_cv.src.models.segmentation import SegmentAnythingModel
from keras_cv.src.models.segmentation import TwoWayTransformer
from keras_cv.src.models.segmentation import YOLOV8Segmentation
from keras_cv.src.models.segmentation.segformer.segformer_aliases import (
SegFormer,
)
Expand Down
3 changes: 3 additions & 0 deletions keras_cv/src/models/segmentation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
SegmentAnythingModel,
)
from keras_cv.src.models.segmentation.segment_anything import TwoWayTransformer
from keras_cv.src.models.segmentation.yolo_v8_segmentation import (
YOLOV8Segmentation,
)
14 changes: 14 additions & 0 deletions keras_cv/src/models/segmentation/yolo_v8_segmentation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 The KerasCV Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from .yolo_v8_segmentation import YOLOV8Segmentation
Loading
Loading