A comprehensive recycling app built with Flutter that uses TensorFlow Lite for live image detection and OpenAI API for classifying whether detected objects are recyclable. The app also integrates with ResilientDB for handling transactions, allowing users to earn tokens for their recyclable items.
-
Live Object Detection: Utilizes TensorFlow Lite for real-time object detection. Tensor flow model used from github
-
Object Classification: Uses OpenAI API to determine if detected objects are recyclable.
-
Token Earning: Users earn tokens based on the number of recyclable items detected.
-
Transaction Logging: Integrates with ResilientDB to log transactions and retrieve transaction details.
- Flutter SDK: Ensure you have Flutter installed. Follow the installation guide here.
- VS Code: After installing the Flutter SDK and following the steps, you can install the Dart extension.
- XCode: For IOS development
Clone the repository to get started:
git clone https://github.com/your-repo/recycling-app.git
cd recycling-app
Install Flutter dependencies:
flutter pub get
The app uses a TensorFlow Lite model for real-time object detection and the OpenAI API for classifying objects as recyclable. It is advised to use the OpenAI API key for the app to function correctly.
To run the app, use the following command:
flutter run
- Start Scanning: Open the app and start scanning items using your camera.
- Real-Time Detection: The app uses TensorFlow Lite to detect objects in real-time.
- Classification: Detected objects are classified using the OpenAI API to determine if they are recyclable.
- Stop Scanning: After scanning, users can stop the process and proceed to the next page.
- Enter Details: On the next page, users enter their name.
- Recyclable Items Count: The app displays the number of recyclable items detected.
- Post Transaction: Users post a transaction to earn tokens for their recyclable items.
- Transaction Details: The transaction details are retrieved and displayed to the user.
The app integrates with ResilientDB to handle transactions, allowing users to log their recycling efforts and earn tokens. Transactions are logged using GraphQL APIs provided by ResilientDB, ensuring secure and transparent transaction handling.
mutation {
generateKeys {
publicKey
privateKey
}
}
mutation {
postTransaction(data: {
operation: "CREATE",
amount: 50,
signerPublicKey: "yourPublicKey",
signerPrivateKey: "yourPrivateKey",
recipientPublicKey: "recipientPublicKey",
asset: """{
"data": {
"time": 1690881023169,
"name": "Rohan",
"recycled_items": 3
}
}"""
}) {
id
}
}
query {
getTransaction(id: "transactionId") {
id
version
amount
metadata
operation
asset
publicKey
uri
type
}
}
Postman can be used to test and translate the GraphQL queries into equivalent Dart code for use in the Flutter app. By making API calls through Postman, you can easily debug and generate the necessary headers, body, and GraphQL query formats required for integration. This is particularly useful when working with complex GraphQL queries and mutations, allowing you to verify their correctness before implementing them in Dart.
Please fork the repository and submit a pull request with your contributions.
fc1f27f7-6469-4ae7-8b36-eae659248257.MP4
This project is licensed under the MIT License - see the LICENSE file for details.