This project demonstrates how to use the Azure Computer Vision API with Python to analyze images and extract meaningful insights. It features modular input via JSON, robust error handling, and clean integration with Azure services.
This project was built as part of a Coursera course and reflects the practical application of cloud-based computer vision.
ComputerVisionProject/
├── vision_test.py # Main Python script
├── image.json # JSON input with image URLs or paths
├── requirements.txt # Python dependencies
├── .env # Environment variables
├── .gitignore # Files to exclude from Git
├── LICENSE # MIT license
└── README.md # Project overview and instructions
git clone https://github.com/your-username/ComputerVisionProject.git
cd ComputerVisionProject
pip install -r requirements.txt
Create a .env
file in the root directory and add your Azure credentials:
ENDPOINT=https://your-endpoint.cognitiveservices.azure.com/
SUBSCRIPTION_KEY=your_subscription_key
Edit the image.json
file to include the image URLs or local paths you want to analyze:
{
"images": [
"https://example.com/image1.jpg",
"https://example.com/image2.png"
]
}
python vision_test.py
The script will analyze the images and display results such as:
- Image descriptions
- Tags and labels
- Objects detected
- Faces detected
- Color schemes and dominant colors
- Text extraction (OCR)
The project uses the following Python packages:
azure-cognitiveservices-vision-computervision==0.7.0
msrest==0.6.21
requests==2.31.0
python-dotenv==1.0.0 # Optional: Only needed if using a .env file for credentials
To install them manually:
pip install azure-cognitiveservices-vision-computervision msrest requests
If you're using a .env file to manage your API keys or environment variables, include:
pip install python-dotenv
This project is licensed under the MIT License. See the LICENSE file for more details.
This project was completed as part of the Azure Computer Vision course on Coursera. (https://coursera.org/share/0b8ae8ed5063bfe20c416931cd33ebed)
Special thanks to:
- Microsoft Azure - for providing the Computer Vision API.
- Coursera - for offering a structured learning platform.
- OpenAI - for assisting in technical documentation.
- N. S. Dilara Liyanage
- BSc (Hons.) in Computer Science - SLIIT
- Passionate about ethical AI, ML, Data Science and sharing technical knowledge.