keras-team / keras-cv

Industry-strength Computer Vision workflows with Keras
Other
1.01k stars 330 forks source link

RandomResizedCrop bounding box support #667

Closed LukeWood closed 10 months ago

LukeWood commented 2 years ago

@AdityaKane2001 will tackle this

AdityaKane2001 commented 2 years ago

Yup, on it.

AdityaKane2001 commented 2 years ago

@LukeWood do we assume the bounding boxes to be of a specific type? Like xyxy or rel_xyxy?

LukeWood commented 2 years ago

@LukeWood do we assume the bounding boxes to be of a specific type? Like xyxy or rel_xyxy?

You’ll need to accept a bounding_box_format argument and convert internally. After conversion you can perform the transformation, then convert back to the user’s specified format. Check out how shear does this.

ariG23498 commented 1 year ago

I was wondering if this layer was renamed to RandomCropAndResize.

If yes, the layer already supports bounding boxes and we can safely close this issue. https://github.com/keras-team/keras-cv/blob/46e27acd40edcd9486e67ca3adfbd315ae6406fb/keras_cv/layers/preprocessing/random_crop_and_resize.py#L144

(Apologies if I misread something)