The main goal of this project is to use computer vision systems to detect fuel prices from local fuel stations. In order to succeed with this project the group will develop an application which will be enable the user to take pictures of price signs and list fuel prices.
Mobile application - Repository
Take pictures and show price information to the users.
The app is available as a downloadable apk-file for android phones. It is unfortunately not available for iPhone. To download, open this link on your phone. When completed, open the file to install the app.
- Nodejs
- React native with Expo
npm install -g expo-cli
- Expo android or iOS app on your phone
- Navigate to the root folder of the project in your terminal.
- Install all dependencies.
npm install
- start the development server
npm start
- Scan the QR-code printed when the server starts using the Expo app on your phone.
- Open the project code in a text editor or IDE to make changes and see their effect in real time on your phone.
Backend - Repository
Process pictures and stores fuel price related information.
This project requires you to have Python3 and pip installed on your machine. Easiest way to get it is by installing Anaconda. After you have done this, run the command below in cmd/termnial to install the remaining prerequisites.
When running the application locally you need a .env-file. Ask someone in the team for this.
- Navigate to the src folder
- Install all necessary requirements
pip install -r requirements.txt
- Navigate to the app folder
- Run the application
python main.py
- Access the application by navigating to "http://localhost:80" or "http://0.0.0.0:80".
Continous integration is set up so that all commits to the backend-master branch automatically will build a new container. This container wil then be deployed to a custom Azure Container Registry. The application will run as a web service and be available at https://fuelpriceapi.azurewebsites.net/ if everything succeeds!
If you want to build and run the Docker image locally use the below commands:
docker build -t <image-name>:<tag-name> .
docker run -p 80:80 <image-name>:<tag-name>
How to communicate with the server via the REST API. Remark: This is work in progress an breaking changes may occur!
- By location and ID:
/prices/<string:location>/<string:id>
- By location and coordinates:
/prices/<string:location>/coordinates/<string:coordinates>
- By location:
/prices/<string:location>
To insert an data directly as text to the database send a POST request to "/upload/prices" with JSON content on the following form:
{
"new_prices":[{
"county":"trondelag",
"price":15.85,
"location":"63.420876,10.460610",
"fueltype":"diesel"
},{
"county":"trondelag",
"price":16.34,
"location":"63.420876,10.460610",
"fueltype":"gasoline"
},{
"county":"trondelag",
"price":17.31,
"location":"63.420876,10.460610",
"fueltype":"gasoline"
},{
"county":"trondelag",
"price":15.84,
"location":"63.420876,10.460610",
"fueltype":"diesel"
}]
}
To upload and process an image send a POST request to "/upload/image" with JSON content on the following form:
{
"image": "Base64 string here",
"location": "63.420876,10.460610"
}
Screenshot of database structure with example data:
All questions related to the backend or CI/CD-config, can be directed to Mats Tyldum.