HawkerScan is a combined Streamlit + Flask application that:
- Recognizes local Singaporean dishes in images via an AI model.
- Calculates nutritional data based on dish weight.
- Lets users view and edit their personal nutritional intake via Streamlit.
- Provides a /api/process-image endpoint for external devices (e.g., Raspberry Pi) to upload food images.
- User Registration & Login
- Uses Flask-Login for authentication against a SQLite database.
- Dish Image Recognition
- Automatically classifies an uploaded dish image using a custom AI model (
analyze_image()).
- Automatically classifies an uploaded dish image using a custom AI model (
- Nutritional Intake Tracking
- Stores recognized dishes and their macro data in a
nutritional_intaketable. - Displays daily, weekly, or monthly summaries in a Streamlit UI.
- Stores recognized dishes and their macro data in a
- REST API
/api/process-imageendpoint allows remote devices (e.g., Raspberry Pi) to send images + weight data.- Associates each request with a user via a unique API key.
python -m venv .venv
.venv\Scripts\activate
or if using pycharm, you can use terminal in pycharm and check if a venv is already created. (It should be if you configured a python interpreter, if not run the code above)
pip install -r requirements.txt
An example would be like "(.venv) PS C:\Users\Kingston\PycharmProjects\HawkerScan> streamlit run app.py"
streamlit run app.py
Wrong version or missing libraries, the console should tell you which libraries you might be missing ("pip install -r requirements.txt", sometimes doesn't install some libraries properly, so I also had to manually pip install some libraries, sometimes you do have the libraries but it still says not found, in that case pip uninstall and pip install again, if the same error occurs again, try a different version of that library)
Ensure Transformers version is 4.41.1 (transformers==4.41.1), otherwise when uploading you might encounter some errors with dimensions or cache error.
