add SAM2 box -> polygon script#1158
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1158 +/- ##
==========================================
- Coverage 87.43% 87.04% -0.39%
==========================================
Files 20 21 +1
Lines 2538 2655 +117
==========================================
+ Hits 2219 2311 +92
- Misses 319 344 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8b33f4a to
42531ef
Compare
|
This is an important integration and something we have discussed for a long time #460. I'd like to see this merged and get the docs right about this. Here are somethings that are on my mind.
|
That might require actual benchmarking on a proper polygon dataset. There are other routes we can explore like prompting with a center + negative corners to try and encourage circular masks, or refinement with restor/tcd + deepforest boxes. |
Implements #460
I've added this as a standalone script that processes prediction outputs, rather than integrated into the pipeline. Uses box prompts rather than points, but we can experiment with other strategies. I played with an option that uses OAM-TCD masks as a refinement step which worked pretty well, but needs more experimentation to see if it's actually worth doing.
Takes a few seconds per 1024 image on my laptop which I think is pretty decent. I haven't tested on an NVIDIA GPU.
I haven't done/added any evaluation beyond unit tests. Will write docs once we agree on where the best place to put this is.
Some results from LIDAR labels:
Works fine for isolated trees and somewhat well for trees in groups. Here is an output from the script which uses the built-in polygon viz: