החל מ-14 בספטמבר 2026, Video Intelligence API יוצא משימוש באופן רשמי ולא תהיה יותר תמיכה בו. אפשר להמשיך להשתמש ב-Video Intelligence API עד 14 בספטמבר 2027, שבו הוא ייסגר. מומלץ לעבור לקבוצת המודלים של Gemini.
Google משתמשת בטכנולוגיית AI כדי לתרגם תוכן לשפה המועדפת עליך. בתרגומים כאלו עשויות להיות שגיאות.
זיהוי פעולות
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
זיהוי פעולות מזהה פעולות שונות מקליפים של סרטונים, כמו הליכה או ריקוד. יכול להיות שכל אחת מהפעולות תתבצע לאורך כל משך הסרטון, ויכול להיות שלא.
שימוש במודל AutoML
לפני שמתחילים
כדי לקבל מידע נוסף על יצירת מודל AutoML, אפשר לעיין במדריך למתחילים של Vertex AI. הוראות ליצירת מודל AutoML מופיעות בקטע נתוני וידאו במאמר בנושא פיתוח ושימוש במודלים של ML במסמכי התיעוד של Vertex AI.
שימוש במודל AutoML
בדוגמת הקוד הבאה אפשר לראות איך להשתמש במודל AutoML לזיהוי פעולות באמצעות ספריית הלקוח של הסטרימינג.
Python
כדי לבצע אימות ב-Video Intelligence, צריך להגדיר את Application Default Credentials.
מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.
importiofromgoogle.cloudimportvideointelligence_v1p3beta1asvideointelligence# path = 'path_to_file'# project_id = 'project_id'# model_id = 'automl_action_recognition_model_id'client=videointelligence.StreamingVideoIntelligenceServiceClient()model_path="projects/{}/locations/us-central1/models/{}".format(project_id,model_id)automl_config=videointelligence.StreamingAutomlActionRecognitionConfig(model_name=model_path)video_config=videointelligence.StreamingVideoConfig(feature=videointelligence.StreamingFeature.STREAMING_AUTOML_ACTION_RECOGNITION,automl_action_recognition_config=automl_config,)# config_request should be the first in the stream of requests.config_request=videointelligence.StreamingAnnotateVideoRequest(video_config=video_config)# Set the chunk size to 5MB (recommended less than 10MB).chunk_size=5*1024*1024defstream_generator():yieldconfig_request# Load file content.# Note: Input videos must have supported video codecs. See# https://cloud.google.com/video-intelligence/docs/streaming/streaming#supported_video_codecs# for more details.withio.open(path,"rb")asvideo_file:whileTrue:data=video_file.read(chunk_size)ifnotdata:breakyieldvideointelligence.StreamingAnnotateVideoRequest(input_content=data)requests=stream_generator()# streaming_annotate_video returns a generator.# The default timeout is about 300 seconds.# To process longer videos it should be set to# larger than the length (in seconds) of the video.responses=client.streaming_annotate_video(requests,timeout=900)# Each response corresponds to about 1 second of video.forresponseinresponses:# Check for errors.ifresponse.error.message:print(response.error.message)breakforlabelinresponse.annotation_results.label_annotations:forframeinlabel.frames:print("At {:3d}s segment, {:5.1%}{}".format(frame.time_offset.seconds,frame.confidence,label.entity.entity_id,))