__init__.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import collections
  2. from .segment_anything_model import SegmentAnythingModel # NOQA
  3. Model = collections.namedtuple(
  4. "Model", ["name", "encoder_weight", "decoder_weight"]
  5. )
  6. Weight = collections.namedtuple("Weight", ["url", "md5"])
  7. MODELS = [
  8. Model(
  9. name="Segment-Anything (speed)",
  10. encoder_weight=Weight(
  11. url="https://github.com/wkentaro/labelme/releases/download/sam-20230416/sam_vit_b_01ec64.quantized.encoder.onnx", # NOQA
  12. md5="80fd8d0ab6c6ae8cb7b3bd5f368a752c",
  13. ),
  14. decoder_weight=Weight(
  15. url="https://github.com/wkentaro/labelme/releases/download/sam-20230416/sam_vit_b_01ec64.quantized.decoder.onnx", # NOQA
  16. md5="4253558be238c15fc265a7a876aaec82",
  17. ),
  18. ),
  19. Model(
  20. name="Segment-Anything (balanced)",
  21. encoder_weight=Weight(
  22. url="https://github.com/wkentaro/labelme/releases/download/sam-20230416/sam_vit_l_0b3195.quantized.encoder.onnx", # NOQA
  23. md5="080004dc9992724d360a49399d1ee24b",
  24. ),
  25. decoder_weight=Weight(
  26. url="https://github.com/wkentaro/labelme/releases/download/sam-20230416/sam_vit_l_0b3195.quantized.decoder.onnx", # NOQA
  27. md5="851b7faac91e8e23940ee1294231d5c7",
  28. ),
  29. ),
  30. Model(
  31. name="Segment-Anything (accuracy)",
  32. encoder_weight=Weight(
  33. url="https://github.com/wkentaro/labelme/releases/download/sam-20230416/sam_vit_h_4b8939.quantized.encoder.onnx", # NOQA
  34. md5="958b5710d25b198d765fb6b94798f49e",
  35. ),
  36. decoder_weight=Weight(
  37. url="https://github.com/wkentaro/labelme/releases/download/sam-20230416/sam_vit_h_4b8939.quantized.decoder.onnx", # NOQA
  38. md5="a997a408347aa081b17a3ffff9f42a80",
  39. ),
  40. ),
  41. ]