Skip to content

Commit 9889fb9

Browse files
Merge branch 'main' into dependabot/pip/ai/gen-ai-agents/custom-rag-agent/mcp-1.23.0
2 parents 71e0a4c + c3db6be commit 9889fb9

File tree

109 files changed

+7325
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+7325
-107
lines changed

ai/ai-speech/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ Reviewed: 25.09.2025
2525

2626
## GitHub
2727
- [Podcast Generator](https://github.com/oracle-devrel/technology-engineering/tree/main/ai/ai-speech/podcast-generator)
28-
28+
- [CX Conversations Analysis with OCI Speech and OCI Generative AI](../generative-ai-service/cx-conversations-analysis/)
29+
- Application that processes audio files (recordings of CX conversations, e.g. in call centers), transcribing with OCI Speech and makes analytics using Generative AI.
30+
2931
## Architecture Center
3032
- [Implement a web-based user interface for interacting with Oracle Cloud Infrastructure Generative AI Agents](https://docs.oracle.com/en/solutions/oci-genai-speech/index.html)
3133
- [Use OCI Speech to transcribe natural language](https://docs.oracle.com/en/solutions/ai-speech/index.html)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2025 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# OCI Vision Streaming — Setup & Stream Consumption Guide
2+
3+
## Overview
4+
This demo includes two main components:
5+
6+
- **stream-job.py** — Python script for creating and managing OCI Vision stream jobs
7+
- **Stream-analysis.py** — Streamlit app for consuming and visualizing the stream outputs
8+
9+
---
10+
11+
12+
## 1. Prerequisites
13+
14+
Before you start, ensure you have:
15+
16+
- An active **RTSP stream URL** (IP camera or RTSP source)
17+
- A configured **OCI Subnet**
18+
- Proper IAM permissions for:
19+
- Vision
20+
- Stream Jobs
21+
- Object Storage
22+
- An Object Storage bucket + namespace
23+
- A local Python environment with required libraries
24+
25+
---
26+
27+
Install required dependencies:
28+
29+
- pip install -r requirements.txt
30+
31+
## 2. Setting Up a Vision Stream Job
32+
33+
### **Step 1 — Run the script**
34+
35+
python stream-job.py
36+
--compartment-id <OCID>
37+
--subnet-id <OCID>
38+
--camera-url rtsp://...
39+
40+
--namespace <namespace>
41+
--bucket <bucket>
42+
--prefix <prefix-optional>
43+
44+
### **Step 2 — Parameter Definitions**
45+
46+
| Argument | Description |
47+
|---------|-------------|
48+
| `--compartment-id` | Your compartment OCID |
49+
| `--subnet-id` | Subnet OCID used for the Vision Private Endpoint |
50+
| `--camera-url` | RTSP URL of your streaming source |
51+
| `--namespace` | Object Storage namespace |
52+
| `--bucket` | Target Object Storage bucket |
53+
| `--prefix` | Optional intermediate path inside the bucket |
54+
55+
---
56+
57+
## 3. Understanding the Stream Job Steps
58+
59+
The script automatically performs the following actions (in order):
60+
61+
1. **create_private_endpoint**
62+
- Creates a Vision Private Endpoint inside the subnet
63+
- Required for sending frames from your RTSP stream to OCI Vision
64+
65+
2. **create_stream_source, create_stream_job, create_stream_group**
66+
- Defines detection features (object / face detection)
67+
- Creates the streaming job
68+
69+
3. **start_stream_job**
70+
- Starts transmitting frames (max 2 FPS)
71+
- Outputs JSON detection results into the specified bucket
72+
73+
> *If you want the job to keep running, comment out the stop_stream_job call in the script.*
74+
75+
### Notes
76+
77+
- Each subnet can contain **only one** Vision Private Endpoint
78+
- Streaming continues indefinitely unless explicitly stopped
79+
- Buckets may grow rapidly as they are being filled with json files as the stream runs — remember to clean up
80+
- You can list active stream jobs via OCI APIs for more control - the api documentation to do that is available [here](https://docs.oracle.com/en-us/iaas/api/#/en/vision/20220125/)
81+
82+
83+
---
84+
85+
## 4. Consuming Streams with Streamlit
86+
87+
88+
Run the Streamlit app:
89+
90+
- streamlit run Stream-analysis.py
91+
- There are 2 modes to analyze the stream from the streamlit app - object detection or face detection - specify it in the defaults section.
92+
93+
In the Streamlit UI, enter:
94+
95+
- Stream Job OCID
96+
- Bucket name
97+
- Prefix
98+
- Namespace
99+
- Detection type (**Object Detection** or **Face Detection**)
100+
101+
Click **Consume Stream** to view annotated video frames.
102+
103+
> OCI Vision Streaming outputs ~2 FPS by design.
104+
105+
---
106+
107+
## 5. Resource Management (IMPORTANT)
108+
109+
- Always **stop the Stream Job** when you're done.
110+
- Delete resources using the provided cleanup cells in the notebook.
111+
- You may store OCIDs to reuse the same resources without recreating them.
112+
113+
---
114+
115+
## 6. Troubleshooting
116+
117+
**405 – Request Not Allowed**
118+
119+
- Occurs when the stream job is transitioning between states
120+
- If stuck in `UPDATING`, delete the job and recreate it
121+
122+
---
123+
124+
## 7. References
125+
126+
- OCI Vision Streaming Docs
127+
https://docs.oracle.com/en-us/iaas/Content/vision/using/video-stream-processing-top.htm
128+
129+
- OCI Python SDK Reference
130+
https://docs.oracle.com/en-us/iaas/tools/python/2.162.0/api/landing.html
131+
132+
---
133+
134+
## 8. License
135+
Copyright (c) 2025 Oracle and/or its affiliates.
136+
Licensed under UPL 1.0.
137+
See *LICENSE* file for details.

0 commit comments

Comments
 (0)