Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,26 +1,37 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
#
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
## Features
|
| 8 |
|
| 9 |
- πΈ **Photo Upload** - Support for JPG, PNG, WebP formats up to 10MB
|
| 10 |
-
- π **Product
|
| 11 |
- π€ **Smart Analysis** - Uses GPT-4 Vision API for accurate shelf assessment
|
| 12 |
- π **Compliance Scoring** - 1-10 score for product placement effectiveness
|
| 13 |
- π‘ **Actionable Recommendations** - Specific suggestions with impact estimates
|
| 14 |
- π± **Mobile Friendly** - Responsive design for field use
|
| 15 |
- π **Impact Forecasting** - Estimated sales improvement from changes
|
| 16 |
|
| 17 |
-
##
|
| 18 |
|
| 19 |
-
1. **
|
| 20 |
-
2. **
|
| 21 |
-
3. **
|
| 22 |
-
4. **
|
| 23 |
-
5. **
|
|
|
|
| 24 |
|
| 25 |
## Analysis Results
|
| 26 |
|
|
@@ -43,123 +54,29 @@ Get prioritized action items with:
|
|
| 43 |
- π **Impact Predictions** - Expected sales/visibility improvements
|
| 44 |
- π§ **Difficulty Rating** - How easy each recommendation is to implement
|
| 45 |
|
| 46 |
-
##
|
| 47 |
-
|
| 48 |
-
- **Frontend:** Streamlit
|
| 49 |
-
- **AI:** OpenAI GPT-4 Vision API
|
| 50 |
-
- **Image Processing:** Pillow (PIL)
|
| 51 |
-
- **Backend:** Python 3.9+
|
| 52 |
-
- **Hosting:** Hugging Face Spaces
|
| 53 |
-
|
| 54 |
-
## Setup Instructions
|
| 55 |
-
|
| 56 |
-
### For Hugging Face Spaces Deployment
|
| 57 |
-
|
| 58 |
-
1. **Fork/Clone** this repository
|
| 59 |
-
2. **Create** a new Hugging Face Space
|
| 60 |
-
3. **Select** "Streamlit" as the SDK
|
| 61 |
-
4. **Upload** all files to your Space
|
| 62 |
-
5. **Add** your OpenAI API key to Space secrets:
|
| 63 |
-
- Go to Settings β Repository secrets
|
| 64 |
-
- Add: `OPENAI_API_KEY = "your-api-key-here"`
|
| 65 |
-
6. **Deploy** - your app will be live in minutes!
|
| 66 |
-
|
| 67 |
-
### Local Development
|
| 68 |
-
|
| 69 |
-
```bash
|
| 70 |
-
# Clone repository
|
| 71 |
-
git clone <repository-url>
|
| 72 |
-
cd shelf-analyzer
|
| 73 |
-
|
| 74 |
-
# Install dependencies
|
| 75 |
-
pip install -r requirements.txt
|
| 76 |
-
|
| 77 |
-
# Set environment variable
|
| 78 |
-
export OPENAI_API_KEY="your-api-key-here"
|
| 79 |
-
|
| 80 |
-
# Run application
|
| 81 |
-
streamlit run app.py
|
| 82 |
-
```
|
| 83 |
-
|
| 84 |
-
## Configuration
|
| 85 |
-
|
| 86 |
-
The app uses the following configuration (in `config.py`):
|
| 87 |
-
|
| 88 |
-
- **Max Image Size:** 10MB
|
| 89 |
-
- **Supported Formats:** JPG, JPEG, PNG, WebP
|
| 90 |
-
- **AI Model:** GPT-4 Vision Preview
|
| 91 |
-
- **Analysis Timeout:** 60 seconds
|
| 92 |
-
- **Max Retries:** 3 attempts
|
| 93 |
-
|
| 94 |
-
## File Structure
|
| 95 |
-
|
| 96 |
-
```
|
| 97 |
-
shelf-analyzer/
|
| 98 |
-
βββ app.py # Main Streamlit application
|
| 99 |
-
βββ requirements.txt # Python dependencies
|
| 100 |
-
βββ config.py # Configuration settings
|
| 101 |
-
βββ README.md # This file
|
| 102 |
-
βββ utils/
|
| 103 |
-
β βββ __init__.py
|
| 104 |
-
β βββ ai_analyzer.py # AI analysis logic
|
| 105 |
-
β βββ recommendations.py # Recommendation engine
|
| 106 |
-
β βββ ui_components.py # UI display components
|
| 107 |
-
```
|
| 108 |
-
|
| 109 |
-
## Usage Examples
|
| 110 |
-
|
| 111 |
-
### Typical Use Cases
|
| 112 |
-
|
| 113 |
-
- **Merchandisers:** Check product compliance during store visits
|
| 114 |
-
- **Category Managers:** Audit shelf execution across locations
|
| 115 |
-
- **Store Managers:** Optimize product placement for better sales
|
| 116 |
-
- **Retail Auditors:** Document and track display improvements
|
| 117 |
-
|
| 118 |
-
### Sample Workflow
|
| 119 |
-
|
| 120 |
-
1. Walk store aisles with smartphone/tablet
|
| 121 |
-
2. Take photos of key product categories
|
| 122 |
-
3. Analyze each product's shelf presence
|
| 123 |
-
4. Follow AI recommendations immediately
|
| 124 |
-
5. Re-analyze to confirm improvements
|
| 125 |
-
|
| 126 |
-
## API Costs
|
| 127 |
-
|
| 128 |
-
- **Hugging Face Hosting:** FREE β¨
|
| 129 |
-
- **OpenAI API:** ~$0.01-0.04 per analysis
|
| 130 |
-
- **Monthly Estimate:** $20-100 (depending on usage)
|
| 131 |
-
|
| 132 |
-
## Limitations
|
| 133 |
|
| 134 |
-
-
|
| 135 |
-
- Works best with clear, unobstructed shelf views
|
| 136 |
-
- AI accuracy depends on image quality
|
| 137 |
-
- Currently supports single product analysis per photo
|
| 138 |
|
| 139 |
-
##
|
| 140 |
|
| 141 |
-
|
| 142 |
-
-
|
| 143 |
-
-
|
| 144 |
-
- [ ] Analysis history dashboard
|
| 145 |
-
- [ ] Popular product presets
|
| 146 |
|
| 147 |
-
##
|
| 148 |
-
- [ ] Mobile app development
|
| 149 |
-
- [ ] Real-time video analysis
|
| 150 |
-
- [ ] Planogram compliance checking
|
| 151 |
-
- [ ] Team collaboration features
|
| 152 |
|
| 153 |
-
|
| 154 |
|
| 155 |
-
|
| 156 |
-
- Create an issue in this repository
|
| 157 |
-
- Contact: [your-contact-info]
|
| 158 |
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
-
|
| 162 |
|
| 163 |
---
|
| 164 |
|
| 165 |
-
**
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Shelf Photo Analyzer
|
| 3 |
+
emoji: πͺ
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: yellow
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.28.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
---
|
| 12 |
|
| 13 |
+
# πͺ Shelf Photo Analyzer
|
| 14 |
|
| 15 |
+
Professional AI-powered tool for merchandisers and retail managers to analyze product displays on store shelves. Get instant analysis with actionable recommendations to improve product placement and boost sales.
|
| 16 |
|
| 17 |
+
## β¨ Features
|
| 18 |
|
| 19 |
- πΈ **Photo Upload** - Support for JPG, PNG, WebP formats up to 10MB
|
| 20 |
+
- π **Product Detection** - AI-powered product recognition and analysis
|
| 21 |
- π€ **Smart Analysis** - Uses GPT-4 Vision API for accurate shelf assessment
|
| 22 |
- π **Compliance Scoring** - 1-10 score for product placement effectiveness
|
| 23 |
- π‘ **Actionable Recommendations** - Specific suggestions with impact estimates
|
| 24 |
- π± **Mobile Friendly** - Responsive design for field use
|
| 25 |
- π **Impact Forecasting** - Estimated sales improvement from changes
|
| 26 |
|
| 27 |
+
## π Quick Start
|
| 28 |
|
| 29 |
+
1. **Enter** your OpenAI API key
|
| 30 |
+
2. **Upload** a clear photo of the store shelf
|
| 31 |
+
3. **Enter** the product name you want to analyze
|
| 32 |
+
4. **Select** analysis depth (Basic/Detailed/Expert)
|
| 33 |
+
5. **Click** "π Analyze Photo" and wait 15-30 seconds
|
| 34 |
+
6. **Review** results and follow the recommendations
|
| 35 |
|
| 36 |
## Analysis Results
|
| 37 |
|
|
|
|
| 54 |
- π **Impact Predictions** - Expected sales/visibility improvements
|
| 55 |
- π§ **Difficulty Rating** - How easy each recommendation is to implement
|
| 56 |
|
| 57 |
+
## π API Key Required
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
+
- **OpenAI**: Get from [OpenAI Platform](https://platform.openai.com/api-keys)
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
## π‘οΈ Privacy
|
| 62 |
|
| 63 |
+
- API keys never stored permanently
|
| 64 |
+
- Images processed temporarily only
|
| 65 |
+
- No data retention
|
|
|
|
|
|
|
| 66 |
|
| 67 |
+
## π License
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
+
Licensed under Apache License 2.0
|
| 70 |
|
| 71 |
+
## π¨βπ» Author
|
|
|
|
|
|
|
| 72 |
|
| 73 |
+
**Marek Staniszewski**
|
| 74 |
+
Heuristica
|
| 75 |
+
π [www.heuristica.pl](http://www.heuristica.pl)
|
| 76 |
+
π§ staniszewski@heuristica.pl
|
| 77 |
|
| 78 |
+
For questions, suggestions, or support, please contact the author.
|
| 79 |
|
| 80 |
---
|
| 81 |
|
| 82 |
+
**Shelf Photo Analyzer** - Professional shelf analysis tool πͺ
|