In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to use TensorFlow to create smart scales, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this can learn, I hope you can gain something.
Use TensorFlow to automatically read weight from scale pictures and plot it over time. You will learn the basics of TensorFlow object detection API and be able to apply it to this and other image analysis projects.
Weight automatically detected from analysis images using TensorFlow (lines are more jagged on the right due to more data points)
This article is intentionally kept short so that a good overview can be quickly obtained, while providing links to other materials with more detailed information.
Get your scale image
First, as with any machine learning project, data is key. Every time you step on the scale, take a picture of it, and the weight will be clearly displayed. For best results, take photos under different lighting conditions and possibly in different areas of the house. 100 photos should serve as a pretty good training set.
If your photos are backed up to Google Photos, then you can use scripts to download them.
https://github.com/xiaowen/weightcheck/blob/master/scale/dlphotos.py
marker image
Next, label the image using tools such as labelImg. Their docker images are easy to set up and use with a few simple commands. A label called "scale" was added around the entire scale bar, and another label called "read" was added around the circular display. labelImg will create an XML file for each image, as shown below.
With bounding box drawn around the scale and scale image around the display
Train a neural network to detect your size
Once the data is available, neural networks can be trained to detect scale in images. At a high level, the steps are as follows:
1. Install TensorFlow Object Detection API
2. Install gcloud, the command-line tool used to submit jobs to the Google Cloud Machine Learning (ML) engine.
3. Create Google Cloud Platform Storage Partitions. Training data will be stored here.
4. Upload a pre-trained model to start your training. TensorFlow provides some common models for model zoos. ssd_mobilenet_v1_coco is a popular choice that strikes a good balance between speed and accuracy for simple models.
5. Prepare custom input data and upload it to cloud storage.
6. Bundle TensorFlow object detection source code run by ML engine.
7. Update the object detection profile. Can reuse mine with minimal changes.
8. Submit the training assignment to the ML engine. Note that the ML engine takes a few minutes to start the job.
9. As the training job runs, it writes its state to the bucket every ten minutes. You can use TensorBoard to monitor it and find convergence of the curve. If running on a single GPU, this job may take several hours to converge.
10. When the model is fully trained, download and export it.
11. Perform some inference using the derived model. The results can be viewed using TensorFlow's demo Jupyter notebook.
TensorBoard screenshot; left: convergence of loss curve; right: inferred output displayed side by side with hand-annotated bounding box
Training neural networks to read displays
Now that you've trained a neural network to detect your weight, the next step is to train a neural network to read your weight from the scale.
Fortunately, this process is almost identical to the one already completed. At a high level, the steps are as follows:
1. Automatically crop display images using trained scale models. You can try scripts to perform this task.
2. Each number in these images is labeled to teach the neural network to recognize them. Labels are used for each number (0-9) and '%'. The label map passed to the object detection code is here.
3. Train the neural network to recognize numbers using the same steps as above. Due to differences in training data, use a slightly modified object detection profile and label mapping.
Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.