-
Notifications
You must be signed in to change notification settings - Fork 301
YOLOV8 port to keras-hub #1899
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
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
…only implementation
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 updates! What's the current progress of the PR? Is it nearly ready to merge?
raise ValueError( | ||
"`bounding_box.mask_invalid_detections()` requires inputs to be " | ||
"Dense tensors. Please call " | ||
"`bounding_box.to_dense(bounding_boxes)` before passing your boxes " |
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.
Where is to_dense
actually located?
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.
In keras-cv to_dense
was located outside of the training loop when building a tf.data
pipeline.
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 bounding box code is now moved to keras repo
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.
anything that is bbox relates should be in Keras and if this models needs something new specifically just add it in the model folder
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.
I think we need a plan here. Bounding box support is coming into core Keras.
Why does this need to be public? Where will it be called by a user? How can we use the new Keras bounding box functionality?
We can add utilities to KerasHub. We can add layers (non-max, ciou loss) if we think they are generally useful outside of yolov8 and written in a way that could be usable by other models. We can even do temp things like add a symbol to KerasHub we are going to add to core Keras.
But we should have a clear picture of where we want everything to end up. And like the expected usage we are putting out. Will bounding_box.to_dense(bounding_boxes)
even make sense with the core Keras way of handling bounding boxes?
Hi, thank you! I think it’s nearly ready. Right now, I’m validating the model’s expected convergence with PASCAL, which has turned out to be more challenging than anticipated. After that, the only remaining step will be to go through your comments and incorporate any additional input from Divya. |
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.
did another pass. Can you add numerics verification colab in the PR description?
… was received and how to resolve
|
Hi @oarriaga the task alignment score is using CIoU here I raised this issue keras-team/keras-cv#2253 a while ago as negative ciou scores were resulting in strange assignments |
I'm confused, the marketing for Keras 3 here seems to mention YOLOv8 is already present? Am I missing something? Edit: I guess the marketing states in both keras-cv + KerasHub |
@parthsdoshi it works in inference but not training because of the RaggedArray requirements. |
@parthsdoshi @Lundez both KerasCV and KerasHub are available for training and inference. The previous shared notebooks provided an example in the VOC dataset. |
@oarriaga your example is using TensorFlow, could you please share how I do training with PyTorch backend on the keras_cv model? |
All the internal components of the model are framework independent. However, the training pipeline does use tf.data. One should be able to modify the training pipeline with a PyDataset, or a custom python generator to manage ragged tensors accordingly. |
What I found with my custom dataset design (PyDataset) is that keras_cv required tf tensors for some bbox functionality and if I recall also something related to loss function. I'll try again, but spent a lot of time on this trying to get pytorch backend working during training. Without success |
This PR ports YOLOV8 from keras-cv to keras-hub (#176). All necessary YOLOV8 functions are now found inside keras-hub:
Missing steps include: