You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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)
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.
Activity
[-]Add support for FlatBug model[/-][+]Add support for FlatBug model & new ML API[/+][-]Add support for FlatBug model & new ML API[/-][+]Add support for FlatBug model[/+]mihow commentedon Aug 15, 2024
related to #515 & #505
mihow commentedon Nov 20, 2024
Blocked by #505 unless we want to implement a simpler version in the current synchronous backend
mihow commentedon Mar 6, 2025
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
mihow commentedon Apr 2, 2025
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)
mohamedelabbas1996 commentedon Aug 27, 2025
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:
The code already sets
antialias=Falsein theResizetransform:resize = transforms.Resize((h, w), antialias=False)But despite that, the model still triggered the unsupported
_upsample_bilinear2d_aaop — likely due to internal behavior intorchvisionor other dependencies that still use anti-aliased upsampling under the hood.To work around this, I set:
export PYTORCH_ENABLE_MPS_FALLBACK=1That 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.