Since I was a small child, I've been obsessed with technology and space. But the computers were still too weak to simulate instruments that are used nowadays (I'm 13 years old btw). But now, computers are much faster and better. So when I found out that there was software that could recognize images and was programmable, I immediately thought of this project.

Step 1: What Is TensorFlow for Poets?

In this project, we will be using Tensorflow for poets. This is opensource software, made by Google to use Deep Machine Learning on images. Basically, Deep Machine Learning is teaching the computer to recognize certain things. If you want to learn more about Machine Learning, you can watch this series made by Google: https://www.youtube.com/watch?v=cKxRvEZd3Mw. Tensorflow for poets is build upon a framework called Inception. Inception was already "trained" by Google to recognize images like dalmatians and dishwashers, but using Tensorflow for poets we can retrain it to recognize pictures of stars and planets.

Step 2: Setting Up Docker

To download Tensorflow for poets, you will need to install Docker first. If you're using a Mac system, continue to step 3 for the installation. If you're using a linux bistro: select your bistro on https://docs.docker.com/engine/installation/ and follow the steps. If you're done with that, go to step 4.

Step 3: Setting Up Docker on OS X

First, go to https://www.docker.com/products/docker-toolbox and download the package for OS X. If the .pkg file is completely downloaded, click on it and go through the installation process. If the installation has ended. Go to launchpad, select Docker Quickstart Terminal and run

docker run hello-world

This should show you if Docker is installed (See in the image above).

Step 4: Installing Tensorflow for Poets

Start Docker and run the following command:

docker run -it gcr.io/tensorflow/tensorflow:latest-devel

This will take a while to install. When it's done, you'll see "root@xxxxxxx#" in front of your command line. This is normal. Now try running python and using the following CODE in python:

You can speed up this process by opening VirtualBox. Select the default machine, click on default, open settings, select system and add more RAM to the process. You if you can't change the value, right-click the machine icon and select close via ACPI. Now you can change the value and start the virtual machine again.

If you want to remove photos or folders, you will have to remove the bottlenecks in the folder /SpaceImages/bottlenecks too

Attachments

Step 6: Bonus Part With Raspberry Pi

This part is optional and if you don't have a Raspberry Pi, or just don't want to use it, Please skip to step 10.

Are you still reading? Good in this part we're gonna program our Raspberry Pi to take a picture if a button is pressed, send this picture to the Mac (you could probably use a linux computer too, but maybe you would have to edit the script a little.) and run the script to recognize it. This script will output the result in the ImageOutput.txt file in the text folder (or if it doesn't exist yet it will create it)

Step 7: Setting Up the Raspberry Pi

Alright, we'll first begin with the easy part: setting up the button. Just connect the button according to the image above (To ground and GPIO 18). Now we'll need to connect the camera to the Raspberry Pi, this can be tricky sometimes. Pull up the white part on the camera connector and push the ribbon cable in. Here's a nice video by the "Raspberry Pi Guy" in which he shows this process:

(You may need to allow usage of the camera using the command: raspi-config. See also in the image above)

Now download the script TelescopeCamera.py from the description to the Raspberry Pi and edit it to your own passwords and usernames (See in the image above)

Attachments

Step 8: Setup Your Mac (or Possibly Linux Computer)

Download the file StartImageRecognition.txt and change the .txt extension to .sh (instructables doesn't accept .sh files). Save this file again to the home folder. Now open the file, you'll see that the PROCESSNUMBER part has to be replaced. To do this you'll need to run

docker ps

And insert the code that looks something like 81764e94e38f on the place of the text PROCESSNUMBER. If docker ps doesn't return anything run the following command:

Attachments

Step 9: Finishing It All

Now run on the Raspberry Pi

sudo python TelescopeCamera.py

And click the button. You now should see an image appear in the folder /SpaceImages/test on the computer and a textfile with the result (see in the image abov). You could now mount your Raspberry Pi under a telescope and test it out, or you could take a more complicated way like in the image above (I haven't got a picture of it because I don't have a telescope myself). This finishes the bonus part.

Step 10: Other Purposes

I used the tensorflow software to recognize planets, but if you copy the script label_images.py, use the same as in this project and change all commands to your new folder name you could also use this software to recognize animals, plants or other objects. I even got face recognition working using this software!

Step 11: Thank You for Reading My Instructable!

If you liked my article, please vote for me in the Space contest. Also leave a comment if you have difficulties with executing this project or if you have feedback.

Epilog Challenge 9

Paper Contest 2018

Trash to Treasure

Tips

Questions

4 Comments

The Android Things platform is also another good alternative to use TensorFlow on the Raspberry Pi. For our test project, we used the TensorFlow Lite version to create the NeuralCandy app that combines image classifier and sugar highs. It uses TensorFlow to locally classify the captured image against the pre-trained ImageNet model, as show below:

Hi, Tensorflow for Poets is sadly not natively supported by Windows. You could try this: https://github.com/tensorflow/tensorflow/issues/4... but I can't guarantee that it will work. You could also dual-boot linux on your device, here's a good tutorial for that: https://www.youtube.com/watch?v=vxepmtjmilQ . Lastly you could install Linux in virtualbox, you can do that by downloading the .iso file from a linux distribution and installing it in virtualbox. Did this answer your question?