Skip to content

99. Code samples for Streamlit

This app includes code samples for Streamlit. You can run the app and select the sample you want to run from the sidebar.

Prerequisites

  • Python 3.10 or later
  • Azure OpenAI Service

Usage

  1. Get Azure OpenAI Service API key
  2. Get Azure AI Search API key
  3. Copy .env.template to .env in the same directory
  4. Set credentials in .env
  5. Run main.py
# Create a virtual environment
$ python -m venv .venv

# Activate the virtual environment
$ source .venv/bin/activate

# Install dependencies
$ pip install -r requirements.txt

# Run the script
$ python -m streamlit run apps/99_streamlit_examples/main.py

Example

Access to http://localhost:8501 and select the sample you want to run from the sidebar.

1. File Q&A

File Q&A

2. Image Q&A

Image Q&A

3. Camera Q&A

Camera Q&A

4. Translate text

Translate text

5. Explain data

Explain data

6. Speech to Text

Speech to Text

7. Text to Speech

Text to Speech

8. Create image

Create image

9. Visualize location

Visualize location

10. Object detection

Object detection

11. Pose estimation

Pose estimation

12. Video processing

Video processing

ref. data-videos/traffic.mp4

References