Senior Software Engineering Project 2024-2025
Amazon Web Services API for Detect Colors and Compare Colors
- Replace image path and double escape the slashes.
- Set coordinates, and multiple are accepted for both endpoints.
Detect colors
Invoke-RestMethod -Method Post -Uri "https://8u8c9zrfa1.execute-api.us-west-1.amazonaws.com/prod/detect-colors" -ContentType "application/json" -Body (ConvertTo-Json @{coordinates = @(@{x=900; y=330}); image_data = [Convert]::ToBase64String([IO.File]::ReadAllBytes("C:\\Users\\pauls\\Documents\\Seattle Pacific University\\Winter 2025\\Software Engineering II - CSC 4152\\WhatColor\\images\\shirts.jpg"))})
Compare colors
Invoke-RestMethod -Method Post -Uri "https://8u8c9zrfa1.execute-api.us-west-1.amazonaws.com/prod/compare-colors" -ContentType "application/json" -Body (ConvertTo-Json @{coordinates = @(@{x=654; y=800}, @{x=654; y=800}); image_data = [Convert]::ToBase64String([IO.File]::ReadAllBytes("C:\\Users\\pauls\\Documents\\Seattle Pacific University\\Winter 2025\\Software Engineering II - CSC 4152\\WhatColor\\images\\shirts.jpg"))}) | Format-List -Force
Local Django API
To utilize the Color Detector Django API, from within the color_detector directory, run:
pip install -r requirements.txt
Start Django development server in separate terminal, run:
python manage.py runserver
Make a color detection request - provide an image to the API from disk, and then add a set of coordinates. Make a request to the API with the PowerShell command:
Invoke-RestMethod -Method Post `
-Uri http://localhost:8000/api/detect_color/ `
-ContentType 'application/json' `
-Body '{"image_path": "C:\\Users\\pauls\\Documents\\Seattle Pacific University\\Autumn 2024\\Software Engineering\\WhatColor\\images\\shirts.jpg", "coordinate": {"x": 900, "y": 330}}'
Make a color comparison request - Provide and image to the API from disk, and then add a set of coordinates. Make a request to the API with the PowerShell Command:
Invoke-RestMethod -Method Post `
>> -Uri http://localhost:8000/api/compare_color/ `
>> -ContentType 'application/json' `
>> -Body '{"image_path": "C:\\\\Users\\\\westo\\\\OneDrive\\\\Pictures\\\\Camera Roll\\\\shirts.jpg", "first_color_coordinates": {"x": "654", "y": "800"}, "second_color_coordinates": {"x": "654", "y": "800"}}'