-
Notifications
You must be signed in to change notification settings - Fork 234
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
YOLOV8 port to keras-hub #1899
base: master
Are you sure you want to change the base?
YOLOV8 port to keras-hub #1899
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @oarriaga left some initial comments
label_encoder=None, | ||
prediction_decoder=None, | ||
**kwargs, | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restructure the code to define all teh layers first, functional model next and config last with these comments
=== Layers ===
.
.
=== Functional model ===
.
.
=== Config ===
.
.
example : https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/bert/bert_backbone.py#L92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Divya, the current model applies multiple blocks of layers. That will imply that we would need to initialize many layers in the constructor. Moreover, the connections between those layers are not so straightforward as in Bert. What would you suggest? Shall we still initialize all layers in the layer block and connect them in the functional block?
def predict_step(self, *args): | ||
outputs = super().predict_step(*args) | ||
if isinstance(outputs, tuple): | ||
return self.decode_predictions(outputs[0], args[-1]), outputs[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will model.fit work ?
@@ -0,0 +1,318 @@ | |||
import os | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add generic task test - self.run_task_test - example : https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/bert/bert_text_classifier_test.py#L41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will need to add preprocessor flow - example follow resnet - https://github.com/keras-team/keras-hub/tree/master/keras_hub/src/models/resnet
|
||
@pytest.mark.large # Saving is slow, so mark these large. | ||
def test_saved_model(self): | ||
model = keras_hub.models.YOLOV8Detector( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use self.run_model_saving_test
- example : https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/resnet/resnet_image_classifier_test.py#L62C9-L62C35
|
||
# TODO(tirthasheshpatel): Support updating prediction decoder in Keras Core. | ||
@pytest.mark.skip(reason="Missing presets") | ||
@pytest.mark.tf_keras_only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no tf_keras_only in KerasHub
…only implementation
This PR ports YOLOV8 from keras-cv to keras-hub (#176). All necessary YOLOV8 functions are now found inside keras-hub:
Missing steps include: