keras-team / keras-cv

Industry-strength Computer Vision workflows with Keras
Other
976 stars 319 forks source link

Add smaller pre-trained backbones to object detection models #1971

Closed elad-c closed 11 months ago

elad-c commented 11 months ago

Short Description Are you going to add smaller back bones (e.g. MobileNetV2) to the object detection models?

jbischof commented 11 months ago

Hi @elad-c, if you check the presets property of our OD models you'll see we already support MobileNet, DenseNet, and EfficientNet. Give them a spin!

model = keras_cv.models.RetinaNet.from_preset(
    "mobilenet_v3_large_imagenet",
    num_classes=20,
    bounding_box_format="xywh",
)
elad-c commented 11 months ago

Folloing the code in object_detection_keras_cv I got the expected results for _"retinanet_resnet50pascalvoc" and _"yolo_v8_mpascalvoc". When I switch _"retinanet_resnet50pascalvoc" with _"mobilenet_v3_largeimagenet" the MaP is 0.0 What am I missing?

jbischof commented 11 months ago

@elad-c the reason is that the two presets you mentioned are e2e task-level to solve VOC. The mobilenet preset is backbone only and will require fine tuning to get meaningful results from the randomly initialized task layers

elad-c commented 11 months ago

Thanks @jbischof , That's what I thought, so I'll rephrase my original question: Is there a plan to expand the e2e task-level presets for object detection, other than "retinanet_resnet50_pascalvoc" and "yolo_v8_m_pascalvoc"?

jbischof commented 11 months ago

No plans @elad-c; these e2e checkpoints are not super useful as they can only predict classes from COCO or PascalVOC; and only well when the images have similar distributions. We mostly ship them for testing and sanity checking

elad-c commented 11 months ago

Ok Thanks for your help! much appreciated.