keras-nlp icon indicating copy to clipboard operation
keras-nlp copied to clipboard

Adding Differential Binarization model from PaddleOCR to Keras3

Open gowthamkpr opened this issue 1 year ago • 2 comments

This adds the Differntial Binarization model for text detection.

Implemented the architecture based on ResNet50_vd from PaddleOCR and ported the weights.

gowthamkpr avatar Aug 06 '24 08:08 gowthamkpr

Let's split this up. Start with ResNetVD backbone?

Some notes...

  • Remove the aliases. One ResNetVDBackbone can handle all of these with different presets.
  • Conversion scripts as scripts not colabs.
  • Follow the local style for backbones as closely as possible. See some comments here https://github.com/keras-team/keras-nlp/pull/1737
  • Keep models a flat directory. No backbones/xx etc.
  • Add some tests.

mattdangerw avatar Aug 06 '24 17:08 mattdangerw

@gowthamkpr is the PR ready for review?

divyashreepathihalli avatar Sep 25 '24 19:09 divyashreepathihalli

Hi @gowthamkpr! can you please refactor the code to KerasHub style?

  • [ ] Add a preprocessor flow
  • [ ] subclass image segementer model for the task class
  • [ ] add preset class
  • [ ] add standard test routines

divyashreepathihalli avatar Oct 24 '24 19:10 divyashreepathihalli

Hi @gowthamkpr! can you please refactor the code to KerasHub style?

I've refactored using SAM as example.

* [ ]  Add a preprocessor flow

I've added DifferentialBinarizationPreprocessor and DifferentialBinarizationImageConverter.

* [ ]  subclass image segementer model for the task class

I've subclassed ImageSegmenter, but I left the custom compile() method, since we need a different loss than the one used in ImageSegmenter's compile().

* [ ]  add preset class

Done. The model is not yet in Kaggle, so I've disabled the presets test for now.

* [ ]  add standard test routines

Done. Not sure if there are additional standard test routines other than the ones used in SAM that should be run.

gowthamkpr avatar Oct 29 '24 21:10 gowthamkpr

Closing this since the continuation PR is in progress here https://github.com/keras-team/keras-hub/pull/2095

sachinprasadhs avatar May 07 '25 20:05 sachinprasadhs