Spaces:
Sleeping
Sleeping
| # Streamlit Testing App - Setup Guide | |
| ## Installation | |
| ```bash | |
| pip install streamlit gradio_client | |
| ``` | |
| ## Running Locally | |
| ```bash | |
| cd plate-detector | |
| streamlit run streamlit_app.py | |
| ``` | |
| ## Fixing API Errors | |
| If you see errors like: | |
| ``` | |
| β Cannot find a function with `api_name`: /detect | |
| β Cannot find a function with `api_name`: /run_query | |
| ``` | |
| ### Step 1: Find Correct API Names | |
| 1. Open the sidebar and click **"Show Available APIs"** button | |
| 2. This will display all available API endpoints from your Space | |
| 3. Look for the correct function names | |
| ### Step 2: Update API Names | |
| Edit `streamlit_app.py` and update these lines: | |
| ```python | |
| API_NAME_DETECT = "/predict" # Change this to actual API name | |
| API_NAME_QUERY = "/predict_1" # Change this to actual API name | |
| ``` | |
| Common patterns: | |
| - First function: `/predict` | |
| - Second function: `/predict_1` | |
| - Or numbered: `/predict_0`, `/predict_1`, etc. | |
| ### Step 3: Test Again | |
| ```bash | |
| streamlit run streamlit_app.py | |
| ``` | |
| ## Features | |
| β **Detection Tab** - Upload image and detect license plate | |
| β **Query Tab** - Natural language database queries | |
| β **Analytics Tab** - View statistics and trends | |
| β **API Debugging** - Shows available endpoints and errors | |
| ## Troubleshooting | |
| | Issue | Solution | | |
| |-------|----------| | |
| | `use_column_width deprecated` | β Fixed - already updated to `use_container_width` | | |
| | API not found | Click "Show Available APIs" in sidebar to see correct names | | |
| | Connection failed | Make sure Space URL is correct: `BARATH0070/plate-detector` | | |
| | No results | Check if HF_TOKEN and DATABASE_URL are set in your Space | | |
| ## Notes | |
| - This is a LOCAL testing app only | |
| - Do NOT push to HF Spaces | |
| - Use it to test UI/UX before deploying | |
| - Make sure your Gradio Space is running and accessible | |