Skip to content

Add support for FlatBug model #412

Open

Description

@mihow

Add new ML Pipeline that runs the FlagBug object detector. Will require adding Order-level taxonomic entries as well. Optionally support polygons in addition to bounding boxes.

https://github.com/darsa-group/flat-bug/

Activity

  1. added this to the Internal Beta Launch milestone on Jun 10, 2024
  2. self-assigned this
    on Jun 10, 2024
  3. changed the title [-]Add support for FlatBug model[/-] [+]Add support for FlatBug model & new ML API[/+] on Aug 12, 2024
  4. changed the title [-]Add support for FlatBug model & new ML API[/-] [+]Add support for FlatBug model[/+] on Aug 12, 2024
  5. mihow commented on Aug 15, 2024

    @mihow
    CollaboratorAuthor

    related to #515 & #505

  6. mihow commented on Nov 20, 2024

    @mihow
    CollaboratorAuthor

    Blocked by #505 unless we want to implement a simpler version in the current synchronous backend

  7. mihow commented on Mar 6, 2025

    @mihow
    CollaboratorAuthor

    Let's do this as simply as possible using a synchronous backend first. Wrap flatbug in this API and publish as a container
    https://github.com/RolnickLab/antenna/tree/main/processing_services/example/api

  8. assigned and unassigned on Apr 2, 2025
  9. mihow commented on Apr 2, 2025

    @mihow
    CollaboratorAuthor

    It turns out this will be needed for the OOD Panama trip since we will be testing new types of monitoring stations (not the AMI systems that the current detector was trained for)

  10. mohamedelabbas1996 commented on Aug 27, 2025

    @mohamedelabbas1996
    Contributor

    I initially tried running the FlatBug model locally on CPU, but it took a really long time to complete. So I switched to trying it with MPS on my Mac.
    While doing that, I ran into this error:

    NotImplementedError: The operator 'aten::_upsample_bilinear2d_aa.out' is not currently implemented for the MPS device.
    

    The code already sets antialias=False in the Resize transform:
    resize = transforms.Resize((h, w), antialias=False)
    But despite that, the model still triggered the unsupported _upsample_bilinear2d_aa op — likely due to internal behavior in torchvision or other dependencies that still use anti-aliased upsampling under the hood.
    To work around this, I set:
    export PYTORCH_ENABLE_MPS_FALLBACK=1
    That allowed the operation to fall back to CPU and the pipeline to run successfully though with a bit of a performance hit due to device switching. In the end, I was able to run the model and get the bounding boxes as expected. Inference time was approximately 48 seconds per image using this approach, with some performance impact due to device switching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions