Tensor Flow Object Detection over Telegram Bot, my breakfast, fruits and an interactive conversation – Best Telegram

Tensor Flow Object Detection over Telegram Bot, my breakfast, fruits and an interactive conversation

In this article we will explore a case where we combine the detection of objects in images using Tensor Flow(Object Detection API) and the interaction through a bot architecture(Telegram platform).

The challenge is to create a bot with the ability to interact using images in a conversation to inform the user of the fruits contained in their breakfast. Using this information this piece of software can deliver many variations of analysis in the future, so far only a proof of concept.

We will propose an integration of TensorPhotoXRay (our image detection solution, previous article) to detect fruits into the images and we will create an integration with a Telegram Bot (project appengine-telegram-bot).

This is the solution finished and working:

Let’s describe the basic elements to use this architecture.

Creation of the bot in Telegram: You can explore more about this option over this official link. *Important Element of this step, get the token to intect the Telegram platform.

Creating the bot Telegram solution: Let’s create an App Engine-based bot.(project appengine-telegram-bot). *This is the method of analysis for messages from Telegram, and the call to the method of detection of images.

*we used more than 50% of confidence to show tags. Here you will find the complete project to deploy.

Deploy the Telegram Bot solution: in this example the solution is designed for Google App Engine traditional environment. You should pay special attention to these elements:

  • Telegram Token: To get this information and create the bot on the Telegram platform you should talk to BotFather. Here you have all the official instructions.
  • Url integration with TensorPhotoXRay: Once the solution is deployed, you will need the url to perform the analysis. Remember that you have a new method with this format:

rooturl/photobot/photourl

  • rooturl: app engine url.
  • photourl: photo’s url to analyze.

Hook Configuration for Telegram: You should deploy the solution on App Engine. When this action is completed, you will have this urls format.

rooturl/fruit_analysis

*rooturl: app engine url

Deploy TensorPhotoXRay solution: This activity can be performed following these instructions. Remember, this solution uses App Engine Flexible Environments.
*I made a modification on the original project to add a new method that returns only one array of tags on the image detection.

This is the new method:

Final step, link Telegram with our Bot developed

Now let the fun begin…

  • For the bot link with our App Engine solution, we must set the hook.(only visit this link and validate web_hook config ok)

rooturl/set_webhook

  • rooturl: app engine url

Now we can interact with a component that allows us to collaborate in our food options, in the future suggest and learn in a very flexible way.

There are several elements to evolve and improve, but this simple solution shows an interesting path full of new opportunities in the interaction with users.

Ten articles before and after

100K Telegram Members Reward Distributed – Best Telegram

6 Telegram Channels for Crypto Traders in 2021 – Best Telegram

PyCryptoBot with Telegram. I received a feature request in the… – Best Telegram

Get Verified in One Click: EXMO Integrates The Telegram Passport Option – Best Telegram

Talking with Arduino using Telegram and JavaScript – Best Telegram

How Not to Get Hacked on Telegram – Best Telegram

Telegram bot for Hacking & Pentesting – Best Telegram

Money For Knowledge: Distribution Via Telegram Quiz Bot – Best Telegram

The Zimmermann Telegram. The story of one of the biggest… – Best Telegram

Come realizzare un bot Telegram (uno dei tanti modi) – Best Telegram