Comments (10)
Additionally, we should be able to vectorize area computation in the iou function
What version do you want to implement? We have a vectorized IOU in:
https://github.com/tensorflow/models/blob/master/official/vision/detection/utils/box_utils.py#L643
It is quite the same of the old vectorized benchmarks in:
https://medium.com/@venuktan/vectorized-intersection-over-union-iou-in-numpy-and-tensor-flow-4fa16231b63d
from keras-cv.
Also with the scope of having a reusable component library for CV we have also in TF Addons:
https://github.com/tensorflow/addons/blob/master/tensorflow_addons/losses/giou_loss.py#L107-L128
from keras-cv.
Wow, thank you for the vectorized iou. This will save me a lot of time.
from keras-cv.
Additionally, we should be able to vectorize area computation in the iou function
What version do you want to implement? We have a vectorized IOU in: https://github.com/tensorflow/models/blob/master/official/vision/detection/utils/box_utils.py#L643
It is quite the same of the old vectorized benchmarks in: https://medium.com/@venuktan/vectorized-intersection-over-union-iou-in-numpy-and-tensor-flow-4fa16231b63d
moved to https://github.com/tensorflow/models/blob/master/official/legacy/detection/utils/box_utils.py
from keras-cv.
Profile trace of COCORecall:
Looks like TensorScatterAdds make up for 20% of compute costs. To fix this, I can use a TensorArray in COCOBase of shape (num_categories*num_thresholds) then reshape it after stacking. This will be much more efficient.
Additionally, we should look into the cost of the sum operations.
from keras-cv.
Can you share the gist to reproduce this as we still don't have any CI infra for PR performance regression check?
I suppose one of the problem is that TensorSCattterAdd
and Sum
are in the inner loop.
Is StridedSlice
also coming from _match_boxes
innner loop?
The top 3 occurrences in the inner loops are going to take 48,5%
of the device time.
from keras-cv.
Can you share the gist to reproduce this as we still don't have any CI infra for PR performance regression check?
Unfortunately no. This uses an internal profiling tool.
I suppose one of the problem is that TensorSCattterAdd and Sum are in the inner loop.
Yeah, the sum operation I expect we can't improve. The ScatterND add, I would bet we can improve this drastically. I will be updating the results to TensorArrays, which should help a lot.
Re: StridedSlice and matching boxes:
I also expect this to take a lot of compute time, it may just be an inherent truth of the algorithm required to compute the metric.
from keras-cv.
I think we need to be on the same page to test this also with the same (simulated/random?) input size. Can you share your benchmark gist?
Have you checked if you are ok with the constrains imposed by:
https://www.tensorflow.org/api_docs/python/tf/vectorized_map
from keras-cv.
moved to https://github.com/tensorflow/models/blob/master/official/legacy/detection/utils/box_utils.py
The new box and iou ops are in:
https://github.com/tensorflow/models/tree/master/official/vision/beta/ops
from keras-cv.
Unfortunately no. This uses an internal profiling tool.
:( Sorry
from keras-cv.
Related Issues (20)
- Metrics for YOLOv8 model HOT 6
- Division of data into training and validation set & COCO Metric Callback not working with Keras CV implementation as expected HOT 4
- About YoloV8 License HOT 6
- rules for `pyramid_level_inputs`?
- Bounding Box Cropping Layer: Feature Request HOT 1
- keras_cv.src.backend.keras' has no attribute 'src HOT 10
- Resizing layer with mixed_precision HOT 2
- MobileNetv4 HOT 3
- Wrong bounding boxes in the visualization of `tfds.datasets.kitti` HOT 2
- Error when training YOLOV8 with jax backend HOT 10
- Bad YOLOv8 performance when compared to Ultralytics implementation HOT 6
- Using large dataset from a TF record the model doesnt train anything HOT 3
- How to contribute pretrained models? HOT 2
- Add DINOv2 HOT 4
- take over video swin checkpoints HOT 11
- FasterRCNN and ROIAlign are Non-Functional in Master HOT 1
- DropBlock2D not working with TensorFlow backend in graph mode on Keras 3 HOT 1
- Detecting more than 100 objects in a single image using retinanet HOT 1
- Image Classifier Task Can't Export to Tensorflow saved model format or to TFLite HOT 6
- Can't Select Activation / Output for DeepNetV3Plus, broken example for 1 class
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras-cv.