Detecting food quality with Raspberry and TensorFlow.

MQ-2 module.
MCP3008 converter.
Breadboard and MQ-2 sensor.
Breadboard with sensors.
Breadboard and cheese together.
Electronic circuit with sensors.
Circuit over food.
Sensors on sockets.
Schematic for the prototype.
Data in the form of a .csv file.
Divided data.
MQ-3 diagram.
Training and validation loss over time.
input_array = []            
for item in lst:
input_array.append(float(item))

test_features = np.array(input_array).astype(np.float32) test_features = np.expand_dims(test_features, axis=0)

# Load the TFLite model and allocate tensors.
interpreter = tflite_runtime.Interpreter(model_path="food_model_250.tflite") interpreter.allocate_tensors()

# Get input and output tensors details.
input_details = interpreter.get_input_details() output_details = interpreter.get_output_details() print(input_details)
print(output_details)interpreter.set_tensor(input_details[0]['index'], test_features)
interpreter.invoke()

# The function `get_tensor()` returns a copy of the tensor data. # Use `tensor()` in order to get a pointer to the tensor. output_data = interpreter.get_tensor(output_details[0]['index']) print(output_data)
Android application with result.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store