dgewe /
Chat-App-Android
Chat app based on the MVVM architecture using Kotlin, ViewModel, LiveData, DataBinding and more.
80/100 healthLoading repository data…
arrohisrivastava0 / repository
A kotlin based weather prediction android application integrating IoT and ML tflite model to predict weather condition based on real-time data.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
This Android app fetches real-time temperature and humidity data from IoT devices via Azure Blob Storage and predicts weather conditions using a machine learning model, implemented with TensorFlow Lite.
Selected from shared topics, language and repository description—not editorial ratings.
dgewe /
Chat app based on the MVVM architecture using Kotlin, ViewModel, LiveData, DataBinding and more.
80/100 healthmomintahir /
This application demonstrates modern Android development with Koin, Ktor, Coroutines, Flows, SQLDelight, Voyager based on Clean Architecture.
55/100 healthdgewe /
The data used for this model is a custom-made dataset built using python pandas. The dataset used is indian_weather_dataset3.csv, which contains the following columns:
• Temperature (°C)
• Humidity (%)
The sole reason for using such a simple dataset is because of its high interpretability. While using a large real-world dataset can improve the performance of our machine learning model and can help in making better predictions, the crux of this project is the integration of machine learning to Android applications. We the Android club expects the audience to learn the process through this event and bring even more complex ideas to life.
This Python script demonstrates the process of building a machine learning model to predict weather conditions based on temperature and humidity data. The model uses a neural network built with TensorFlow and Keras, and is trained on a dataset of Indian weather conditions.
• Data preprocessing with pandas and scikit-learn. • Neural network model creation with TensorFlow. • Model evaluation and predictions.
• Python 3.x • Pandas • NumPy • Matplotlib • TensorFlow • scikit-learn
The model is built using TensorFlow's Keras API, which allows for an intuitive stack of layers using Sequential. The architecture comprises: Input Layer: It takes the input with the shape corresponding to the number of features (2 in this case: temperature and humidity). Dense Layers: Two hidden layers with 64 and 32 neurons respectively, both using ReLU activation functions. ReLU is chosen for its efficiency and effectiveness in adding non-linearity to the model. Output Layer: The final layer has several neurons equal to the number of unique weather conditions, using a softmax activation function. Softmax makes the output sum up to one so the output can be interpreted as probabilities.
The model is compiled with the Adam optimizer and sparse categorical crossentropy as the loss function. Adam is preferred for its adaptive learning rate capabilities, making it suitable for data with varying scales. Sparse categorical crossentropy is used as the loss function because it is efficient with categorical target variables that are represented as integers.
The decision to use TensorFlow Lite for IoT integration is driven by its efficiency and compatibility with edge devices. TensorFlow Lite models are tailored for deployment on resource-constrained platforms, offering optimal performance with minimal computational overhead. This makes it ideal for real-time applications like weather prediction on IoT devices. In simple language, tensorflow-lite models work efficiently in embedded devices like raspberry pi or android phones , without lagging and slowing the process.
We start by importing necessary libraries. • numpy for numerical operations. • load_model from keras.models to load our pre-trained weather prediction model stored in an HDF5 file. • os for operating system functionalities. • tensorflow library itself (tf) to utilize TensorFlow functionalities.
converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()
INFO:tensorflow: Assets written to: C:\Users\soodv\AppData\Local\Temp\tmp13c6f28x\assets
Here we use the TensorFlow Lite Converter (tf.lite.TFLiteConverter) to convert our loaded Keras model (model) into a TensorFlow Lite compatible format. This step is essential for optimizing the model for deployment on mobile or edge devices.This line actually performs the conversion of our Keras model (model) into a TensorFlow Lite model. Finally, we save the converted TensorFlow Lite model (tflite_model) into a file named Weather_predictor.tflite. The model is written in binary ('wb') mode into this file using the write() method of the file handler (f). This .tflite file can now be deployed and used efficiently on mobile devices or embedded systems. Now you can look for the file in the file explorer and integrate it with the Android studio which would be discussed later.
How your app looks is specified in the activity_main.xml here
implementation("org.tensorflow:tensorflow-lite-support:0.1.0")
implementation("org.tensorflow:tensorflow-lite-metadata:0.1.0")
implementation("org.tensorflow:tensorflow-lite-gpu:2.3.0")
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.google.code.gson:gson:2.8.8'
import org.tensorflow.lite.Interpreter
You can get the model from "asset" section or follow the link -> Tflite file
import com.example.demo.ml.WeatherPredictor
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
data class SensorData(
val temperature: Double,
val humidity: Double,
val EventProcessedUtcTime: String,
val PartitionId: Int,
val EventEnqueuedUtcTime: String,
val IoTHub: IoTHub
)
data class IoTHub(
val MessageId: String?,
val CorrelationId: String?,
val ConnectionDeviceId: String,
val ConnectionDeviceGenerationId: String,
val EnqueuedTime: String
)
import retrofit2.Call
import retrofit2.http.GET
interface ApiService {
@GET("<YOUR_JSON_FILE_NAME>.json") //Json file name
fun getSensorData(): Call<List<SensorData>>
}
Here, We:
val baseUrl = "https://<YOUR_ACCOUNT_NAME>.blob.core.windows.net/<YOUR_BLOB_STORAGE_NAME>/"
val accKey =
"<YOUR_ACCOUNT_KEY>"
val retrofit = Retrofit.Builder()
.baseUrl("$baseUrl?${accKey}")
.addConverterFactory(GsonConverterFactory.create())
.build()
val service = retrofit.create(ApiService::class.java)
private fun fetchData(service: ApiService) {
service.getSensorData().enqueue(object :
Movie app based on the MVVM architecture using Kotlin, ViewModel, LiveData, DataBinding and more.
threeal /
Location-based AR app for Smart Tourism project using Android Studio and Kotlin
68/100 healthSameer411 /
A Kotlin based Android Application For Text Recognition
45/100 healthpedromassango /
A android location app based on user's contacts. Try it here ->
25/100 health