Answers.Body: <p>There is a YouTube video <a href="https://www.youtube.com/watch?v=wSSh9iV70ng" rel="nofollow noreferrer">LEGO EV3 Raspberry Pi Tensorflow Sorting Machine</a> by <a href="https://www.youtube.com/channel/UCOziWS9PkSVwB0XoIE14rDw" rel="nofollow noreferrer">ebswift</a> that should help you although you will need a Raspberry Pi.  From the abstract:</p>
  
  <p><em>This is a sorting machine based on the EV3 45544 education kit sorting machine.  The colour sorting camera is substituted with a Raspberry Pi with the v2 camera.  The EV3 is controlled over wifi via RPyC and the object recognition work is done via Tensorflow.</em>  </p>
  
  <p><strong>A viewer asked</strong>: Can you share links about how to train a model on the PC and move the trained model to the Pi?</p>
  
  <p><strong>ebswifft replied</strong>:
  Glad you like it :).  Training the model on the PC is following the guide for Tensorflow for Poets <a href="https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/" rel="nofollow noreferrer">https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/</a>.  All you do is install Tensorflow on the Raspberry Pi, clone the github repository onto it and copy the model you trained from the codelabs article onto the Raspberry Pi to run the classifier as per step 5 of the codelabs article.  Onboard image capture on the Raspberry Pi is just done using picamera.  I used a tensorflow version that a user compiled for the Raspberry Pi from here: <a href="https://github.com/samjabrahams/tensorflow-on-raspberry-pi/issues/92" rel="nofollow noreferrer">https://github.com/samjabrahams/tensorflow-on-raspberry-pi/issues/92</a>.  I might do up more of a general step-by-step sometime on my site, I'll report back if I can get that up and running.</p>
  
  <p>There is also <a href="https://github.com/robodhhb/BrickClassifi3r" rel="nofollow noreferrer">BrickClassifi3r</a>:</p>
  
  <p><em>This Lego Mindstorms EV3 robot uses a neural network to recognize a cube, a cylinder or a small cube put on a conveyor belt. See the video how it works. Each object on the conveyor belt is scanned by an IR-sensor every 40ms for about a second. The resulting data are 24 distance values representing one of the three objects. This data is fed into the neural network on the robot to classify the object within 180ms. In a test with 300 objects it reaches 95,6% accuracy. The neural network has been trained before by a machine learning algorithm with TensorFlow on a PC using a set of 375 training examples - 125 examples for each object.</em></p>
  
  <p>The <a href="https://github.com/aljazfrancic/ev3-myo" rel="nofollow noreferrer">ev3-myo</a> project uses LEGO Mindstorms EV3, TRACK3R, a Myo armband and TensorFlow for gesture recognition.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-15T01:00:03.500Z
Answers.Text: The first one looks great, but I don't have the source code for it. The second one also looks appealing, however, I don't understand how he's connecting the neural network to the robot, as the tensorflow recognitions aren't visible in the .rtf files. Also, this doesn't really how to implement the code. Any ideas on how to do that?
Answers.UserDisplayName: shreyshrey
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-15T01:15:48.730Z
Answers.Text: I added some more information for the first option.  Also check out the ev3-mvo project in my answer.
Answers.UserDisplayName: Brian O'Donnell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-15T01:24:42.770Z
Answers.Text: If you haven't used TensorFlow for object detection I suggest you start there before diving into the EV3.
Answers.UserDisplayName: Brian O'Donnell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-15T00:25:32.437Z
Answers.LastActivityDate: 2019-05-15T01:13:05.493Z
Answers.LastEditDate: 2019-05-15T01:13:05.493Z
Answers.UserDisplayName: Brian O'Donnell
Answers.Body: <p>Get a raspberry with a camera, power it by a battery bank, attach it to the EV3 and run a 2 one program on raspberry and another on ev3 communicating with each other via MQTT</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-23T14:22:46.667Z
Answers.LastActivityDate: 2020-07-23T14:22:46.667Z
Answers.UserDisplayName: Mirek Čolakov
Body: <p>I've got a Lego Mindstorms EV3 with <a href="https://www.ev3dev.org/" rel="nofollow noreferrer">EV3DEV</a> and EV3-Python installed. I wanted to try out artificial intelligence with the robot, and my first project is going to be to get the robot to try and recognize some images (using convolutions) and do an action related to the image it has seen. However, I can't find a way to use Tensorflow (or any AI module for that matter) on an EV3. Does anyone know how to incorporate Tensorflow or any other modules into the EV3? Help would be gladly appreciated.</p>
  
Tags: <python><tensorflow><robotics>
Title: How do I integrate Tensorflow with EV3DEV?
UserDisplayName: shreyshrey
ThreadText: # How do I integrate Tensorflow with EV3DEV?
  
  (Asked by: username_0 on 2019-05-14)
  
  I've got a Lego Mindstorms EV3 with [EV3DEV](https://www.ev3dev.org/) and EV3-Python installed. I wanted to try out artificial intelligence with the robot, and my first project is going to be to get the robot to try and recognize some images (using convolutions) and do an action related to the image it has seen. However, I can't find a way to use Tensorflow (or any AI module for that matter) on an EV3. Does anyone know how to incorporate Tensorflow or any other modules into the EV3? Help would be gladly appreciated.
  
  **Tags:** python, tensorflow, robotics
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-05-15. Score: 1
  
  There is a YouTube video [LEGO EV3 Raspberry Pi Tensorflow Sorting Machine](https://www.youtube.com/watch?v=wSSh9iV70ng) by [ebswift](https://www.youtube.com/channel/UCOziWS9PkSVwB0XoIE14rDw) that should help you although you will need a Raspberry Pi. From the abstract:
  
  *This is a sorting machine based on the EV3 45544 education kit sorting machine. The colour sorting camera is substituted with a Raspberry Pi with the v2 camera. The EV3 is controlled over wifi via RPyC and the object recognition work is done via Tensorflow.*
  
  **A viewer asked**: Can you share links about how to train a model on the PC and move the trained model to the Pi?
  
  **ebswifft replied**:
  Glad you like it :). Training the model on the PC is following the guide for Tensorflow for Poets <https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/>. All you do is install Tensorflow on the Raspberry Pi, clone the github repository onto it and copy the model you trained from the codelabs article onto the Raspberry Pi to run the classifier as per step 5 of the codelabs article. Onboard image capture on the Raspberry Pi is just done using picamera. I used a tensorflow version that a user compiled for the Raspberry Pi from here: <https://github.com/samjabrahams/tensorflow-on-raspberry-pi/issues/92>. I might do up more of a general step-by-step sometime on my site, I'll report back if I can get that up and running.
  
  There is also [BrickClassifi3r](https://github.com/robodhhb/BrickClassifi3r):
  
  *This Lego Mindstorms EV3 robot uses a neural network to recognize a cube, a cylinder or a small cube put on a conveyor belt. See the video how it works. Each object on the conveyor belt is scanned by an IR-sensor every 40ms for about a second. The resulting data are 24 distance values representing one of the three objects. This data is fed into the neural network on the robot to classify the object within 180ms. In a test with 300 objects it reaches 95,6% accuracy. The neural network has been trained before by a machine learning algorithm with TensorFlow on a PC using a set of 375 training examples - 125 examples for each object.*
  
  The [ev3-myo](https://github.com/aljazfrancic/ev3-myo) project uses LEGO Mindstorms EV3, TRACK3R, a Myo armband and TensorFlow for gesture recognition.
  
  > **Comments:**
  > **username_0**: The first one looks great, but I don't have the source code for it. The second one also looks appealing, however, I don't understand how he's connecting the neural network to the robot, as the tensorflow recognitions aren't visible in the .rtf files. Also, this doesn't really how to implement the code. Any ideas on how to do that?  
  > **username_1**: I added some more information for the first option.  Also check out the ev3-mvo project in my answer.  
  > **username_1**: If you haven't used TensorFlow for object detection I suggest you start there before diving into the EV3.  
  
  ---
  
  ### Answer by username_2 on 2020-07-23. Score: 0
  
  Get a raspberry with a camera, power it by a battery bank, attach it to the EV3 and run a 2 one program on raspberry and another on ev3 communicating with each other via MQTT
  
  
  ---
  
  