Always output inaccurate results
#34
by Gureumi - opened
Example code from model card
import torch
from transformers import AutoModelForCausalLM
moondream = AutoModelForCausalLM.from_pretrained(
"moondream/moondream3-preview",
trust_remote_code=True,
dtype=torch.bfloat16,
device_map={"": "cuda"},
token="hugging face token"
)
moondream.compile()
image = Image.open("street_scene.jpg")
result = moondream.detect(image, "car")
print(result)
This example code result is
{'objects': [
{'x_min': 0.0033763647079467773, 'y_min': 0.01665535569190979, 'x_max': 0.9966236352920532, 'y_max': 0.9833446443080902},
{'x_min': 0.3129466772079468, 'y_min': 0.01665535569190979, 'x_max': 1.3061939477920532, 'y_max': 0.9833446443080902},
{'x_min': 0.3129466772079468, 'y_min': 0.01665535569190979, 'x_max': 1.3061939477920532, 'y_max': 0.9833446443080902},
{'x_min': 0.0033763647079467773, 'y_min': 0.01665535569190979, 'x_max': 0.9966236352920532, 'y_max': 0.9833446443080902},
{'x_min': 0.0033763647079467773, 'y_min': 0.01665535569190979, 'x_max': 0.9966236352920532, 'y_max': 0.9833446443080902},
{'x_min': 0.0033763647079467773, 'y_min': 0.01665535569190979, 'x_max': 0.9966236352920532, 'y_max': 0.9833446443080902},
{'x_min': 0.0033763647079467773, 'y_min': 0.01665535569190979, 'x_max': 0.9966236352920532, 'y_max': 0.9833446443080902},
{'x_min': 0.0033763647079467773, 'y_min': 0.01665535569190979, 'x_max': 0.9966236352920532, 'y_max': 0.9833446443080902},
{'x_min': 0.0033763647079467773, 'y_min': 0.01665535569190979, 'x_max': 0.9966236352920532, 'y_max': 0.9833446443080902},
{'x_min': 0.0033763647079467773, 'y_min': 0.01665535569190979, 'x_max': 0.9966236352920532, 'y_max': 0.9833446443080902},
{'x_min': 0.0033763647079467773, 'y_min': 0.01665535569190979, 'x_max': 0.9966236352920532, 'y_max': 0.9833446443080902}
]}
This is the same output in the reference of the moondream-station.
The document itself on moondream.ai and the hugging face may be incorrect or outdated.
The only way it's worked out is using https://github.com/m87-labs/kestrel