ที่เก็บนี้มีรหัสที่รองรับโมเดลฐาน GPT-4V สำหรับใช้กับ Autodistill
GPT-4V พัฒนาโดย OpenAI เป็นรูปแบบภาษาที่หลากหลาย ด้วย GPT-4V คุณสามารถถามคำถามเกี่ยวกับรูปภาพในภาษาธรรมชาติ โมดูล autodistill-gpt4v ช่วยให้คุณสามารถจำแนกภาพโดยใช้ GPT-4V
รุ่นนี้ใช้ GPT-4-Vision-Preview API ที่ประกาศโดย OpenAI เมื่อวันที่ 6 พฤศจิกายน 2566
บันทึก
การใช้โครงการนี้จะต้องเสียค่าใช้จ่ายในการเรียกเก็บเงินสำหรับการเรียก API ไปยัง OpenAI GPT-4 Vision API อ้างถึงหน้าการกำหนดราคา OpenAI สำหรับข้อมูลเพิ่มเติมและเพื่อคำนวณราคาที่คาดหวัง แพ็คเกจนี้ทำให้การโทร API หนึ่งรายการต่อภาพที่คุณต้องการติดฉลาก
อ่านเอกสาร Autodistill เต็มรูปแบบ
อ่านเอกสาร GPT-4V Autodistill
ในการใช้ GPT-4V กับ Autodistill คุณต้องติดตั้งการพึ่งพาต่อไปนี้:
pip3 install autodistill-gpt-4v from autodistill_gpt_4v import GPT4V
# define an ontology to map class names to our GPT-4V prompt
# the ontology dictionary has the format {caption: class}
# where caption is the prompt sent to the base model, and class is the label that will
# be saved for that caption in the generated annotations
# then, load the model
base_model = GPT4V (
ontology = CaptionOntology (
{
"person" : "person" ,
"a forklift" : "forklift"
}
),
api_key = "OPENAI_API_KEY"
)
base_model . label ( "./context_images" , extension = ".jpeg" )โครงการนี้ได้รับใบอนุญาตภายใต้ใบอนุญาต MIT
เรารักการป้อนข้อมูลของคุณ! โปรดดูคู่มือการสนับสนุน Core Autodistill เพื่อเริ่มต้น ขอบคุณผู้สนับสนุนทุกคนของเรา!