import textwrap
import json
import openai
from llmcam.fn_to_fc import *

source

detect_objects

 detect_objects (image_path:str, conf:float=0.25)

Run YOLO object detection on an input image.

Type Default Details
image_path str Path/URL of image
conf float 0.25 Confidence threshold
Returns str JSON format of detection results
YTLiveTools = [tool_schema(fn) for fn in (capture_youtube_live_frame_and_save, ask_gpt4v_about_image_file, detect_objects)]
def exec_func(name, tools=[], **kwargs):
    res = globals().get(name)(**kwargs)
    return res
messages = form_msgs([
    ("system", "You are a helpful system administrator. Use the supplied tools to assist the user."),
    ("user", "Hi, can you capture YouTube Live?"),
    ("user", "You can use the default link."),
    ("user", "Can you extract information from this file?"),
    ("user", "Use your new tool to detect."),
])
complete(messages, YTLiveTools, exec_func)
print_msgs(messages)