Skip to content

Commit 0c04f88

Browse files
Add D-FINE to KerasHub (#2318)
* init: Add initial project structure and files * test: Enable test cases (will fail until HGNetV2 dep added) * refactor: Make clean and consistent API design choices * refactor: Remove the task model from the scope of this PR * refactor: Enhance test suite robustness and standardize weight init to match original * nit: Remove the problematic channel_axis from the deserialization args * nit: Replace hyphen with underscore in preset name * refactor: Implement code cleanup based on review feedback * refactor: Address code reviews * nit: Remove unnecessary Keras serialization decorator * refactor: Resolve review comments * update: Enable HGNetV2 and D-FINE tests! * test: Enable `run_data_format_check` * feat: Add DFineObjectDetector (TODO: Make loss batch-aware) * skipif: Bbox utils are not supported before Keras < 3.8.0 * test: Minor implementation review * Complete TODO: Make loss fully batch-aware * finals: Add adaptation explanations; denoising query range * fix: GPU tests + memory optimization * change: Reduce memory usage with minimal test configuration * reviews: Incorporate comments * nits: Move loss to separate file + address review feedback (Gemini, Sachin) * nit: Skip HF preset loading test on TensorFlow GPU CI due to an unknown OOM error
1 parent d625954 commit 0c04f88

25 files changed

+8979
-17
lines changed

keras_hub/api/layers/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
from keras_hub.src.models.cspnet.cspnet_image_converter import (
7676
CSPNetImageConverter as CSPNetImageConverter,
7777
)
78+
from keras_hub.src.models.d_fine.d_fine_image_converter import (
79+
DFineImageConverter as DFineImageConverter,
80+
)
7881
from keras_hub.src.models.deeplab_v3.deeplab_v3_image_converter import (
7982
DeepLabV3ImageConverter as DeepLabV3ImageConverter,
8083
)

keras_hub/api/models/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@
108108
from keras_hub.src.models.cspnet.cspnet_image_classifier_preprocessor import (
109109
CSPNetImageClassifierPreprocessor as CSPNetImageClassifierPreprocessor,
110110
)
111+
from keras_hub.src.models.d_fine.d_fine_backbone import (
112+
DFineBackbone as DFineBackbone,
113+
)
114+
from keras_hub.src.models.d_fine.d_fine_object_detector import (
115+
DFineObjectDetector as DFineObjectDetector,
116+
)
117+
from keras_hub.src.models.d_fine.d_fine_object_detector_preprocessor import (
118+
DFineObjectDetectorPreprocessor as DFineObjectDetectorPreprocessor,
119+
)
111120
from keras_hub.src.models.deberta_v3.deberta_v3_backbone import (
112121
DebertaV3Backbone as DebertaV3Backbone,
113122
)

keras_hub/src/models/d_fine/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)