support box threshold in GD 1.5 demos

This commit is contained in:
rentainhe
2024-10-31 15:50:14 +08:00
parent e537a1e763
commit 1aec7ded16
4 changed files with 7 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ SOURCE_VIDEO_FRAME_DIR = "./custom_video_frames"
SAVE_TRACKING_RESULTS_DIR = "./tracking_results"
API_TOKEN_FOR_GD1_5 = "Your API token"
PROMPT_TYPE_FOR_VIDEO = "box" # choose from ["point", "box", "mask"]
BOX_THRESHOLD = 0.2
"""
Step 1: Environment settings and model initialization for SAM 2
@@ -108,6 +109,7 @@ task = DetectionTask(
prompts=[TextPrompt(text=TEXT_PROMPT)],
targets=[DetectionTarget.BBox], # detect bbox
model=DetectionModel.GDino1_6_Pro, # detect with GroundingDino-1.5-Pro model
bbox_threshold=BOX_THRESHOLD,
)
client.run_task(task)