huggingface / sam2-studio

Apache License 2.0
289 stars 18 forks source link

CLI #3

Closed pcuenca closed 2 months ago

pcuenca commented 2 months ago

I'm creating a CLI target to test and compare against the Python Core ML runner and the PyTorch baseline.

pcuenca commented 2 months ago

This is ready for an initial review. There are a few things that can be improved, though:

I have enough for testing right now, but let me know if any of these are important for you @FL33TW00D @cyrilzakka

FL33TW00D commented 2 months ago

Solid 🚀

cyrilzakka commented 2 months ago

Will work on these today! Can do the last box input + loading model

cyrilzakka commented 2 months ago

@pcuenca Not sure if I'm misunderstanding you, but:

  1. I think the app currently works by default as multipoint inputs (all points are always fed into the model). Maybe I should rework it so points are deleted when a segmentation image is generated? Or add a 'segment' button when all points are placed? What do you think?
  2. Box points seem to be working. Is there anything I'm missing?
  3. Working on the last part! Will also try to re-work the app so it uses CIImage as you suggested. There also seems to be some weird resizing bug when an image is taller than it is wide. Will investigate.
pcuenca commented 2 months ago

Hi @cyrilzakka! Those points were only about the CLI, I added a command-line argument to indicate a list of points, but there's no support for boxes yet (but there is in the main app). Model loading was intended to help testing / debugging in the CLI. I think it'd be useful in the main app as well, but it's not critical in my opinion.

cyrilzakka commented 2 months ago

Oops my bad! Will work on the last two action items in the meantime then