-
Notifications
You must be signed in to change notification settings - Fork 233
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
[RetinaNet] Image Converter and ObjectDetector #1906
base: master
Are you sure you want to change the base?
Conversation
…neeli/keras-hub into sineeli/add-retinanet-phase-2
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 @sineeli!! Looks generally good!! I have left a few comments.
Also, I want to make sure the -The code usage is updated to reflect the correct implementation - https://docs.google.com/document/d/15FUEP_vNehwLWJLragXhPFkYcbmmpbo0NYh5vL6q1xA/edit?tab=t.0
metrics=None, | ||
**kwargs, | ||
): | ||
"""Configures the `ImageSegmenter` task for training. |
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.
update docstring for object detection
object detection tasks. It is intended to be paired with a | ||
`keras_hub.models.ImageObjectDetector` task. | ||
|
||
All `ImageObjectDetectorPreprocessor` take inputs three inputs, `x`, `y`, and |
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.
All
ImageObjectDetectorPreprocessor take inputs three inputs
-> ImageObjectDetectorPreprocessor class acceptes three inputs: x, y, and...
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.
Done
data_format = standardize_data_format(data_format) | ||
input_levels = [int(level[1]) for level in backbone.pyramid_outputs] | ||
backbone_max_level = min(max(input_levels), max_level) | ||
image_encoder = keras.Model( |
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.
ooo, we have an image_encoder here. haha, any suggestions for name here other than image_encoder
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.
for input args: image_encoder
(Backbone)
for pyramid outputs extraction: feature_extractor
(Resnet with feature pyramid outputs)
Kept some layers |
|
||
The `ImageObjectDetector` tasks wrap a `keras_hub.models.Backbone` and | ||
a `keras_hub.models.Preprocessor` to create a model that can be used for | ||
image classification. `ImageObjectDetector` tasks take an additional |
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.
Object detection
anchor_size: float. Scale of size of the base anchor relative to the | ||
feature stride 2^level. | ||
anchor_generator: A `keras_hub.layers.AnchorGenerator`. | ||
bounding_box_format: str. TODO: |
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 can still add a line of description here for the arg.
`RetinaNetObjectDetectorPreprocessor` class or a custom preprocessor. | ||
activation: Optional. The activation function to be used in the | ||
classification head. | ||
head_dtype: Optional. The data type for the prediction heads. |
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.
The dtype will be the same for the model and the head right? can we just pass dtype here?
) | ||
|
||
# === Functional Model === | ||
image_input = keras.layers.Input(backbone.image_shape, name="images") |
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.
move layers up under === Layers ===
This PR covers preprocessor for RetinaNet object detector and RetinaNet model itself. #1756
ImageObjectDetector
ImageObjectDetectorPreprocessor
RetinaNetObjectDetector
RetinaNetObjectDetectorPreprocessor
RetinaNetImageConverter