This project is an enhanced adaptation of David Padbury's Power Meter Reader, specifically designed to read gas meters provided by Eversource in Hopkinton, MA. Initially using HoughCircles for feature detection, the project has evolved to incorporate a machine learning model, significantly improving accuracy. The process involves cropping to the meter's dials, normalization, and advanced image processing techniques.
- Purpose: Image classification.
- Features: Configures the device for image processing using torchvision, torch, and transforms.
- Purpose: Manages the prediction process in image classification.
- Features: Employs torchvision, torch, and PIL to perform image classification tasks.
- Output: Processes data from gas_meter_reader, delivering four distinct predictions, one for each dial.
- Purpose: Responsible for reading the gas meter and managing the publication of these readings.
- Features: Utilizes system and data handling libraries such as sys, os, and json for integration with data publishing systems.
- Output: Executes the publication of meter readings using MQTT, facilitating real-time data sharing.
- Purpose: Primary script for reading the gas meter using machine vision.
- Features: Implements image processing and machine vision techniques.
- Purpose: Manages global variables of the project.
- Features: Defines variables like flags, error thresholds, sleep times, and dataset paths.
- Purpose: Applies a threshold transform to images.
- Features: Includes the
ThresholdTransform
class for image thresholding.
- Setting Up Global Variables: Configure parameters in
globals.py
, including the training dataset path, error thresholds, etc., before training. - Executing Training: Utilize
image_class_gpt.py
andimage_predict.py
for training. The training utilizes images from the dataset path inglobals.py
, ensuring they represent the meter readings accurately. - Model Training Considerations: The model learns to recognize the gas meter's specific characteristics from the provided images. It's crucial for the images to encompass various readings and lighting conditions for robustness.
Deploy the trained model using gasmeter.py
and gas_meter_reader.py
for actual meter reading and data publishing. The trained model interprets the gas meter readings and, if configured, publishes them using MQTT.
- Webcam: Using a Wyze v3 USB webcam, modified for close focus based on a YouTube tutorial (link).
- Lighting: Employing LED lighting (Amazon link).
- Enclosure: Housed in a Register Duck Boot (Lowes link).
- Custom 3D Printed Enclosure: An enclosure created with a 3D printer. STL file included: STL Download
- Assumption of Increasing Readings: The system assumes a continual increase in gas readings.
- Limitation on Reading Increase: Presumes that readings should not increase by more than 3 units since the last value.
- Correction Method: Corrects discrepancies by replacing the first digit with the first digit from the previous reading and reassessing. This process is repeated for the second and third digits as needed.
- Using RL: Using Reinforcement Learning to improve Prediction.