Skip to content

Commit

Permalink
hide florence2_phrase_grounding_video
Browse files Browse the repository at this point in the history
  • Loading branch information
Dayof committed Oct 4, 2024
1 parent 3febe3a commit 6d6895c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
50 changes: 25 additions & 25 deletions tests/integ/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
florence2_image_caption,
florence2_ocr,
florence2_phrase_grounding_image,
florence2_phrase_grounding_video,
# florence2_phrase_grounding_video,
florence2_roberta_vqa,
florence2_sam2_image,
florence2_sam2_video_tracking,
Expand Down Expand Up @@ -117,30 +117,30 @@ def test_florence2_phrase_grounding_image_fine_tune_id():
assert [res["label"] for res in result] == ["coin"] * len(result)


def test_florence2_phrase_grounding_video():
frames = [
np.array(Image.fromarray(ski.data.coins()).convert("RGB")) for _ in range(10)
]
result = florence2_phrase_grounding_video(
prompt="coin",
frames=frames,
)
assert len(result) == 10
assert 2 <= len([res["label"] for res in result[0]]) <= 26


def test_florence2_phrase_grounding_video_fine_tune_id():
frames = [
np.array(Image.fromarray(ski.data.coins()).convert("RGB")) for _ in range(10)
]
# this calls a fine-tuned florence2 model which is going to be worse at this task
result = florence2_phrase_grounding_video(
prompt="coin",
frames=frames,
fine_tune_id=FINE_TUNE_ID,
)
assert len(result) == 10
assert 16 <= len([res["label"] for res in result[0]]) <= 26
# def test_florence2_phrase_grounding_video():
# frames = [
# np.array(Image.fromarray(ski.data.coins()).convert("RGB")) for _ in range(10)
# ]
# result = florence2_phrase_grounding_video(
# prompt="coin",
# frames=frames,
# )
# assert len(result) == 10
# assert 2 <= len([res["label"] for res in result[0]]) <= 26


# def test_florence2_phrase_grounding_video_fine_tune_id():
# frames = [
# np.array(Image.fromarray(ski.data.coins()).convert("RGB")) for _ in range(10)
# ]
# # this calls a fine-tuned florence2 model which is going to be worse at this task
# result = florence2_phrase_grounding_video(
# prompt="coin",
# frames=frames,
# fine_tune_id=FINE_TUNE_ID,
# )
# assert len(result) == 10
# assert 16 <= len([res["label"] for res in result[0]]) <= 26


def test_template_match():
Expand Down
1 change: 0 additions & 1 deletion vision_agent/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
florence2_image_caption,
florence2_ocr,
florence2_phrase_grounding_image,
florence2_phrase_grounding_video,
florence2_roberta_vqa,
florence2_sam2_image,
florence2_sam2_video_tracking,
Expand Down

0 comments on commit 6d6895c

Please sign in to comment.