Skip to content

Commit af528dc

Browse files
author
Elizabeth
committed
Add agentic video analysis notebook with TwelveLabs and AWS Bedrock Pegasus integration
- Implement specialized video analysis agents using TwelveLabs API - Add AWS Bedrock Pegasus support for video processing - Include video upload, insight generation, and natural language querying - Demonstrate multimodal video content analysis capabilities
1 parent 2fdc27d commit af528dc

1 file changed

Lines changed: 27 additions & 7 deletions

File tree

notebooks/08-agentic-video-analysis.ipynb

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"- TwelveLabs API key from [TwelveLabs Platform](https://playground.twelvelabs.io/)\n",
2727
"- Python 3.9+ environment\n",
2828
"\n",
29-
"**For AWS Bedrock:**\n",
29+
"**For Amazon Bedrock:**\n",
3030
"- AWS account with [Amazon Bedrock model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html)\n",
31-
"- AWS CLI configured with appropriate permissions\n",
32-
"- S3 bucket for video storage"
31+
"- [AWS CLI](https://aws.amazon.com/cli/) configured with appropriate permissions\n",
32+
"- [Amazon S3 bucket](https://aws.amazon.com/s3/) for video storage"
3333
]
3434
},
3535
{
@@ -146,7 +146,7 @@
146146
"\n",
147147
"anthropic_model = AnthropicModel(\n",
148148
" client_args={\"api_key\": ANTHROPIC_API_KEY},\n",
149-
" model_id=\"claude-3-7-sonnet-20250219\",\n",
149+
" model_id=\"claude-3-7-sonnet-20250219\", #or us.claude-3-7-sonnet-20250219 ,see https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html \n",
150150
" max_tokens=1024,\n",
151151
" params={\"temperature\": 0.3}\n",
152152
")\n",
@@ -195,7 +195,7 @@
195195
"outputs": [],
196196
"source": [
197197
"# Summarize an existing video (replace with actual video ID from the list above)\n",
198-
"response = twelvelabs_agent(\"Summarize the first video in the list\")\n",
198+
"response = twelvelabs_agent(\"When is S3 mentioned in the video?\")\n",
199199
"print(response)"
200200
]
201201
},
@@ -298,6 +298,26 @@
298298
"print(response)"
299299
]
300300
},
301+
{
302+
"cell_type": "code",
303+
"execution_count": null,
304+
"id": "1df6abf7",
305+
"metadata": {},
306+
"outputs": [],
307+
"source": [
308+
"response = bedrock_agent(f\"Analyze the video2 and tell me what it's about\")"
309+
]
310+
},
311+
{
312+
"cell_type": "code",
313+
"execution_count": null,
314+
"id": "222e52d8",
315+
"metadata": {},
316+
"outputs": [],
317+
"source": [
318+
"response = bedrock_agent(\"When is S3 mentioned in the video?\")"
319+
]
320+
},
301321
{
302322
"cell_type": "markdown",
303323
"id": "example_analyze_bedrock",
@@ -330,7 +350,7 @@
330350
"source": [
331351
"## Comparison: TwelveLabs vs AWS Bedrock\n",
332352
"\n",
333-
"| Feature | TwelveLabs | AWS Bedrock |\n",
353+
"| Feature | TwelveLabs | Amazon Bedrock |\n",
334354
"|---------|------------|-------------|\n",
335355
"| **Setup** | API key required | AWS credentials required |\n",
336356
"| **Video Processing** | Index-based, persistent | Direct analysis |\n",
@@ -349,7 +369,7 @@
349369
"\n",
350370
"For more help, refer to:\n",
351371
"- [TwelveLabs Documentation](https://docs.twelvelabs.io/)\n",
352-
"- [AWS Bedrock Documentation](https://docs.aws.amazon.com/bedrock/)\n",
372+
"- [Amazon Bedrock Documentation](https://docs.aws.amazon.com/bedrock/)\n",
353373
"- [Strands Agents Documentation](https://strandsagents.com/)"
354374
]
355375
},

0 commit comments

Comments
 (0)