This is the fastest and easiest way to realize images on a laptop or a stationary PC without any graphic processor, because this can only be done with the help of API, and your computer will do this task perfectly.
I know that I was a little late with a story about this API, because he walked with the early version of Tensorflow. The API uses the CNN model, trained in grades 1000. For more information, study the TensorFlow website.
Before I show how to use this API to work with any image, we will consider the following example.
We will consider the input data an image of a space rocket/shuttle.
The output result is the inscription "Cosmic shuttle (probability = 89.639%)" on the command line.
Do not worry if you have Linux or Mac. I am sure that this will work on any system with any CPU if you already have TensorFlow 1.4. The process will be executed in 4 stages:
1. Download the model from the Tensorflow repository
Follow the link, download the Tensorflow repository to your computer and remove it to the root folder, and since I use Windows, I will remove it to the “C:” disk.
Now name the Models folder.
2. Team string
Run the command line (on behalf of the administrator).
Now we need to launch the Classify_Image.py file, which is located in Models> Tutorials> Imagenet> Classify_Image.py, enter the image commands below and press Enter.
After that, the model (200 MB) will be downloaded, which will help you with the recognition of your image.
If everything went well, on the command line you will see the following:
Now, to make sure that we understand how to work with the model, we will do it twice. Place one image in the "Models> Tutorials> Imagenet>", and the other in another folder 😏.
3. Download the image in the folder
Take any image from the Internet or from somewhere else and place it in the “Models> Tutorials> Imagenet> Images.png” folder with the classify_image.py file, and then to the “D: Images.png” folder or any other catalog, simply Do not forget to indicate the correct address on the command line. The image that I used is given below.
4. Use the command line for recognition
To do this, you just need to edit the argument “ - image_file” as follows.
a) for the image in the same catalog as the Classify_Image.py file, after moving to the Imagenet directory, enter the command line on the command line
Result
Now it is clear that the results for both images are the same, as shown below.
It can be seen that the assessment is quite accurate, that is, 98.028% for the mobile phone class.
Note. Use any image that you want and keep it in any directory convenient for you. The main thing is to indicate the right path to him on the command line.
#machinelearning #artificialintelligence #ai #datascience #programming #Deechnology #Deeuplearning #bigData #bigdata