Detection Form - TensorFlow

I am trying to prepare a model for defining basic shapes like Circle, Square, Rectangle, etc. using Tensorflow. What would be the best input dataset? To load shapes directly or find the edge of an image using OpenCV and load only the edge image.

We can also define forms using OpenCV. What would be the added benefit of using Machine Learning.

Sample images designed to train the model.

Circle detected using OpenCV Square detection

+5
source share
2 answers

I would recommend starting with this guide for classification, not for object discovery: https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/#0

The classification is intended for one unique tag for one image (99% of the area, 1% of the circle). Object detection is used to classify several objects within an image (x_min = 3, y_min = 8, x_max = 20, y_max30, 99% of the area). Your case is more like a classification problem.

You do not need a full installation of Docker, as in the manual. If you have Python 3.6 on your system, you can simply do:

pip install tensorflow 

And then go to "4. Extracting Images"

I had to try this on my own, so I downloaded the first 100 squares and circles images from Google using the optional β€œfatkun” boot image from the Chrome Web Store.

In my first 10 tests, I get accuracy between 92.0% (0.992 ...) and 99.58%. If your examples are more uniform than many different images from Google, you are likely to get better results.

+2
source

You might want to check for object detection in a tensor stream. https://github.com/tensorflow/models/tree/master/object_detection

There is a prepared model here http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_11_06_2017.tar.gz

One of the potential benefits of using neural networks for detection is that it can reduce processor cycles for computation. This is useful for mobile devices. For example, the Hough transform https://en.wikipedia.org/wiki/Hough_transform is too expensive to calculate /, but if a convolutional neural network was used instead, more options open up for real-time image processing.

Actually train the new model - see here https://www.tensorflow.org/tutorials/deep_cnn

+1
source

Source: https://habr.com/ru/post/1268969/


All Articles