0

I have a devboard (Google Coral). There are some scripts in there to perform image classification and object detection.

I want the results of those scripts (model, inference_time, score, image, etc) to be sent/indexed into Elasticsearch.

Also, there is a camera (came with the board) that I can use and take photos (there is a script for it too).

My approach so far has been:

  1. I wrote a script using Paramiko to connect to the devboard. (It is in my PC)

  2. Still, using Paramiko, I executed the scripts which are inside the devboard (turn on camera, wait until spacebar to take photo, make classification, send results to a server)

  3. The results are indexed into Elasticsearch (it is installed in my PC).

I would like to know if there is a better way to do what I have done. What confuses me is that I have to connect to the board to execute a script (takes photo and performs classification). But I also have other script (in my PC) which connects to the devboard to give instructions, collect results and index them into Elasticsearch. Should I have put everything inside the devboard? Should I have used a serial communication? Should I have used subprocesses?

@JGK

Aizzaac
  • 3,146
  • 8
  • 29
  • 61

1 Answers1

1

I guess this is more of a design questions than a technical issue :)

I'm not sure if this approach will works for you, but if I was to design this:

1) On the Dev Board, design an http server that is constantly ready to take a GET/image request. If the request is received, take a picture, and return the image + classification results to the client. Here are a couple of similar projects (disclaimer, one is mine): [restor, snowzach/doods, ...]

Note that those 2 servers were designed for different things than what you're trying to accomplish. They are expecting the client to send the image and then return the result. While in your case, your client is expecting both image and result from the server.

2) On the client just send a request, and your server should send back the image + results.

3) On the client side, since you already have the result, send that to elastic search.

Nam Vu
  • 1,727
  • 1
  • 11
  • 24
  • Ok, thank you. I am electrical engineer, so I need some advice in design questions :) – Aizzaac Jun 19 '20 at 17:06
  • 1
    I see, well, I'm open for more questions :) But this project is potentially more familiar to you since it is in python: https://github.com/robmarkcole/coral-pi-rest-server FYI electrical engineering is hard for me lol – Nam Vu Jun 19 '20 at 18:20
  • I am using the 'snapshot' tool to take the photos. What have you used? OpenCV? – Aizzaac Jun 26 '20 at 19:16
  • Yes, I really like opencv, it's a very nice and has great documentation – Nam Vu Jun 26 '20 at 19:18
  • Do you think the devboard could send the data directly to elasticsearch? It uses a lot of json. The code that will have to be in the devboard would look like this: ```https://stackoverflow.com/questions/62459572/how-can-i-read-data-from-a-list-and-index-specific-values-into-elasticsearch-us/62460512#62460512``` – Aizzaac Jun 26 '20 at 19:29
  • I tried to install paramiko in the devboard with ```apt-get install ``` but it did not work. So maybe installing the elastiseacrh client would not be possible either. – Aizzaac Jun 26 '20 at 19:31
  • 1
    That is depends on the library, tbh. A lot of library/software were written and build specifically for x86_64 platform, so it may either not work with arm platform or you'd need to build it your self instead of installing prebuilt packages. idk much about much about elastic search, but I got paramiko installed like this: `apt install python3-paramiko` – Nam Vu Jun 26 '20 at 20:04
  • 1
    seems that the team isn't looking to add supports for arm platform: https://discuss.elastic.co/t/kibana-7-x-support-for-arm64-raspberry-pi-4-b/190057/2 – Nam Vu Jun 26 '20 at 20:06
  • They have naswered this: https://github.com/elastic/elasticsearch-py/issues/1302#issuecomment-651293470 – Aizzaac Jul 06 '20 at 21:03
  • I answered :) https://github.com/elastic/elasticsearch-py/issues/1302#issuecomment-654881985 – Nam Vu Jul 07 '20 at 13:58