-
Notifications
You must be signed in to change notification settings - Fork 248
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
Remove bounding box utils and refactor retinanet #2039
base: master
Are you sure you want to change the base?
Conversation
Not sure what best to do about this test failure. @sineeli do you know the minimal version of Keras we would need for all of this? |
It would require latest release |
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! Left some comments
|
||
@keras_hub_export("keras_hub.layers.AnchorGenerator") | ||
class AnchorGenerator(keras.layers.Layer): | ||
"""Generates anchor boxes for object detection tasks. | ||
|
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.
these look like copy paste bugs where selecting from github removes empty newlines. bring these empty newlines back
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.
Sure
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.
This is unfixed. Take a look at the diff here and restore the empty newlines.
If you copy paste from the github ui you will remove all empty newlines from the file, just something to watch out for.
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.
Still a few comments to address. The big one, we need to get rid of the private import of keras for that validation function. Let's remove or duplicate.
We might also want to set things up so the library still works with older keras versions, and throws an error when using an OD model that 3.8 is required. But I can help with that part.
Oh yeah make sense, we can only import when we have Keras>=3.8.0 version and then throw error when this doesn't satisfy? I hope this works. |
@mattdangerw what do you think on |
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! Looking good. Still a few minor things.
|
||
@keras_hub_export("keras_hub.layers.AnchorGenerator") | ||
class AnchorGenerator(keras.layers.Layer): | ||
"""Generates anchor boxes for object detection tasks. | ||
|
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.
This is unfixed. Take a look at the diff here and restore the empty newlines.
If you copy paste from the github ui you will remove all empty newlines from the file, just something to watch out for.
@@ -40,14 +59,15 @@ def call(self, inputs): | |||
if self.norm_std: | |||
x = x / self._expand_non_channel_dims(self.norm_std, x) | |||
|
|||
return x | |||
return x, y, sample_weight |
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.
call pack_x_y_sample_weight
here, it will gracefully handle the no label case.
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.
This still isn't done! Is there an issue with this one?
@sineeli let me know when this is ready again. I think the torch failure looks unrelated. |
@mattdangerw its done you can take a final look and merge it. Thanks for the review!! |
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.
Nice work! Just one last comment I see unresolved.
@@ -40,14 +59,15 @@ def call(self, inputs): | |||
if self.norm_std: | |||
x = x / self._expand_non_channel_dims(self.norm_std, x) | |||
|
|||
return x | |||
return x, y, sample_weight |
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.
This still isn't done! Is there an issue with this one?
non_max_suppression
,anchor_generator
, andbox_matcher
into the modeling layers for better integration.